分?jǐn)?shù)是兩個(gè)整數(shù)的比,通常表示為 (或b/a)的形式,其中b稱為分子,a稱為分母,分母不能為0。分?jǐn)?shù)在計(jì)算機(jī)中以整數(shù)或浮點(diǎn)數(shù)(有限小數(shù))的形式表示,大多數(shù)情況下都是近似表示,具有較大的誤差,例如 ,在計(jì)算機(jī)中用整數(shù)表示為0,用浮點(diǎn)數(shù)表示為0.333333。本實(shí)例就是要設(shè)計(jì)一個(gè)Fraction (分?jǐn)?shù)) 類類型,該類型的對象可以像基本類型數(shù)據(jù)一樣進(jìn)行運(yùn)算,結(jié)果仍為分?jǐn)?shù),運(yùn)算包括四則運(yùn)算,關(guān)系運(yùn)算,及求一元一次分式方程的解,輸入輸出要求按分?jǐn)?shù)方式進(jìn)行。
標(biāo)簽: 分?jǐn)?shù) 整數(shù)
上傳時(shí)間: 2016-02-18
上傳用戶:zhoujunzhen
(1).問題描述:集裝箱的裝箱問題 給定一個(gè)集裝箱,其長為L,寬為W和高為H,現(xiàn)有一批圓柱形木材,每根木材的長均為L,但是半徑不同,設(shè)第i根木材半徑為ri。問如何裝箱,使得集裝箱的空間利用率最高? (2).程序設(shè)計(jì)要求: a. 設(shè)計(jì)一個(gè)貪心算法 b. 任給一個(gè)輸入實(shí)例,能輸出集裝箱的空間利用率 c. 能用圖形演示裝箱的過程 演示: 輸入要測試的文件名,如c17.txt,程序?qū)⒔o出結(jié)果,并用圖形演示。
標(biāo)簽: 集裝箱
上傳時(shí)間: 2014-01-07
上傳用戶:miaochun888
編程題(15_01.c) 結(jié)構(gòu) struct student { long num char name[20] int score struct student *next } 鏈表練習(xí): (1).編寫函數(shù)struct student * creat(int n),創(chuàng)建一個(gè)按學(xué)號升序排列的新鏈表,每個(gè)鏈表中的結(jié)點(diǎn)中 的學(xué)號、成績由鍵盤輸入,一共n個(gè)節(jié)點(diǎn)。 (2).編寫函數(shù)void print(struct student *head),輸出鏈表,格式每行一個(gè)結(jié)點(diǎn),包括學(xué)號,姓名,分?jǐn)?shù)。 (3).編寫函數(shù)struct student * merge(struct student *a,struct student *b), 將已知的a,b兩個(gè)鏈表 按學(xué)號升序合并,若學(xué)號相同則保留成績高的結(jié)點(diǎn)。 (4).編寫函數(shù)struct student * del(struct student *a,struct student *b),從a鏈表中刪除b鏈表中有 相同學(xué)號的那些結(jié)點(diǎn)。 (5).編寫main函數(shù),調(diào)用函數(shù)creat建立2個(gè)鏈表a,b,用print輸出倆個(gè)鏈表;調(diào)用函數(shù)merge升序合并2個(gè) 鏈表,并輸出結(jié)果;調(diào)用函數(shù)del實(shí)現(xiàn)a-b,并輸出結(jié)果。 a: 20304,xxxx,75, 20311,yyyy,89 20303,zzzz,62 20307,aaaa,87 20320,bbbb,79 b: 20302,dddd,65 20301,cccc,99 20311,yyyy,87 20323,kkkk,88 20307,aaaa,92 20322,pppp,83
標(biāo)簽: student struct score long
上傳時(shí)間: 2016-04-13
上傳用戶:zxc23456789
炸彈超人游戲c語言簡板 ,兩個(gè)人碗的,A控制WASD空格,B控制光標(biāo)鍵和回車 命數(shù),關(guān)的風(fēng)格自己在文件頭自己搞定;可以吃的道具由種分別加威力和雷數(shù)(最多8個(gè))--簡單的16色游戲。
標(biāo)簽: c語言
上傳時(shí)間: 2016-04-27
上傳用戶:lhw888
%radon transform clear all % N=800 n=1:N fs=200 t=n/fs x1=exp(j*2*pi*(5*t+0.5*5*t.^2)) x2=exp(j*2*pi*(5*t+0.5*15*t.^2)) x=x1+x2 %N=length(x) % ambifunb(x ) %*****************************************RAT naf=ambifunb(x) htl(abs(naf)) % [wh,rho,theta]=htl(abs(naf)) colormap([0,0,0]) % xlabel( 極半徑 ) % ylabel( 角度 ) %**************************************%找出峰值點(diǎn)的坐標(biāo),計(jì)算初始頻率和調(diào)頻斜率(正確) %找出峰值點(diǎn)的坐標(biāo) b=max(max(wh)) [u,a]=find(wh>=0.8*b)
標(biāo)簽: transform radon clear fs
上傳時(shí)間: 2014-10-27
上傳用戶:Yukiseop
給定一個(gè)圖,設(shè)計(jì)一個(gè)程序,找出一條從某一頂點(diǎn)a到另一頂點(diǎn)b邊數(shù)最少的一條路徑。
標(biāo)簽:
上傳時(shí)間: 2013-12-14
上傳用戶:
寫一個(gè)對文本文件加密的程序和一個(gè)解密的程序。密碼規(guī)則是:對于小寫字母,a換成x,b換成y,c換成z,d換成a,e換成b,...;對于大寫字母,A換成X,B換成Y,C換成Z,D換成A,E換成B,...;其他字符不變。
上傳時(shí)間: 2016-08-16
上傳用戶:jennyzai
(1)熟悉樹的各種表示方法和各種遍歷方式,掌握有關(guān)算法的實(shí)現(xiàn),了解樹在計(jì)算機(jī)科學(xué)及其它工程技術(shù)中的應(yīng)用。試設(shè)計(jì)一個(gè)程序,在計(jì)算機(jī)中構(gòu)造該二叉樹,并對它進(jìn)行遍歷。(2)給定一個(gè)圖,設(shè)計(jì)一個(gè)程序,找出一條從某一頂點(diǎn)A到另一頂點(diǎn)B邊數(shù)最少的一條路徑。
上傳時(shí)間: 2013-12-24
上傳用戶:稀世之寶039
For advanced geometry, most apps will prefer to load pre-authored meshes from a file. Fortunately, when using meshes, D3DX does most of the work for this, parsing a geometry file and creating vertx buffers for us. This tutorial shows how to use a D3DXMESH object, including loading it from a file and rendering it. One thing D3DX does not handle for us is the materials and textures for a mesh, so note that we have to handle those manually.
標(biāo)簽: pre-authored Fortunately advanced geometry
上傳時(shí)間: 2013-12-26
上傳用戶:sssl
Whenever there is an application to write, breaking it up to small pieces is a great idea. The smallest piece of any application would probably be a data object, or a simple Bean in Java. Java Beans are simple Java classes that have a distinctive look and behavior. Their simplest purpose is to contain data and they accomplish this by having properties. Each property is actually a data-member containing/referencing the actual data and a couple of methods, a getter method and a setter method. Thus, the simplest data-bean describing a person could be expressed as such:
標(biāo)簽: small application Whenever breaking
上傳時(shí)間: 2016-11-07
上傳用戶:lingzhichao
蟲蟲下載站版權(quán)所有 京ICP備2021023401號-1