


版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、Q3O8(io 分)第5章實驗2:體型判斷。醫(yī)務(wù)工作者經(jīng)廣泛的調(diào)查和統(tǒng)計分析,根據(jù)身高與體重因素給出了以下按 “體指數(shù)”進(jìn)行體型判斷的方法。體指數(shù)計算公式是:t = w /(h*h)其中:t是體指數(shù);w是體重,其單位為千克;h是身高,其單位為米。根據(jù)給 定的體指數(shù)t計算公式,可判斷你的體重屬于何種類型:當(dāng)t18時,為低體重;當(dāng)18 t25時,為正常體重;當(dāng)25 t27時,為肥胖。*輸入提示信息格式:Please enter h,w:n*輸入數(shù)據(jù)格式要求:f,%f(先讀入身高,再讀入體重,身高以米讀入, 體重以千克讀入)*輸出數(shù)據(jù)格式要求:當(dāng) t18 時,輸出:Lower weight!n當(dāng) 1
2、8 t25 時,輸出:Standard weight!n當(dāng) 25 t27 時, 輸出:Too fat!n#in clude #in clude mai n()float t,w,h;printf(Please enter h,w:n);scan f(%f,%f, &h,&w);t = w/(h*h);if(t=18&t=25&t27)prin tf(Higher weight!n);elseprin tf(Too fat!n);return 0;Q586.(10分)編寫一個程序,輸入年份和月份,判斷該年是否是閏年,并根據(jù)給出的月份判斷是什么季節(jié)和該月有多少天?(閏年的條件是年份能被4整除但不能
3、被100整除,或者能被400整除;規(guī)定35月為春季,68月為夏季,911月為秋 季,1、2和12月為冬季)。* 輸入格式要求:d,%d提示信息:Please enter year,month:* 輸出格式要求:d is leap yearn %d is not leap yearn The seasonis spring/summer/autumn/winterThe numberof days of this month is %dn程序運行示例如下:Please en ter year,mo nth:2012,112012 is leap yearThe seas on is autu m
4、nThe nu mber of days of this month is 30實例2:Please en ter year,mo nth:2013,122013 is not leap yearThe seas on is win terThe nu mber of days of this month is 31#in elude #in elude main ()int year=0,leap=0, mon=0,day=0;prin tf(Please en ter year,m on th:);scan f(%d,%d,&year,&mon);if(year%100!=0&year%4
5、=0)|(year%100=0&year%400=0)prin tf(%d is leap year n,year);leap=1;elseprin tf(%d is not leap year n,year);switeh(m on)ease 1: case 2:case 12:printf(The season is wintern); break;case 3:case 4:case 5:printf(The season is springn); break;case 6:case 7:case 8:printf(The season is summern); break;case 9
6、:case 10:case 11:printf(The season is autumnn); break;switch(mon)case1:case3:case5:case7:case8:case10:case12:day=31;break;case4:case6:case9:case11:day=30;break;case2:if(leap=1)day=29;elseday=28;prin tf(The nu mber of days of this month is %dn,day);Q3161(i 0分)請用else if多分支條件判斷語句編程設(shè)計一個簡單的計 算器程序。要求:(1)請
7、用戶按以下形式從鍵盤輸入表達(dá)式:操作數(shù)運算符op操作數(shù)(2)然后計算表達(dá)式的值*輸入提示信息* :無*輸入數(shù)據(jù)格式* :%f%c%f* 輸出數(shù)據(jù)格式 * : %.2f%c%.2f=%.2fn若若輸入的運算符是除法運算符/,當(dāng)除數(shù)為0時,輸出數(shù)據(jù)格式為:dat is0!Error!n若輸入的運算符不是加(+)、減(-)、乘(*)、除(/),則輸出數(shù)據(jù)格式 為:Error!n友情提示: 用戶輸入的運算符為算術(shù)運算符:加(+)、減(-)、乘(*)、除(/ )。 用字符變量op表示; 操作數(shù)和操作數(shù) 為浮點型數(shù)據(jù),分別用浮點型變量 dat1、dat2表示。 程序運行結(jié)果如下所示:1+2/+=#in c
8、lude #in clude mai n()float a=0,b=0;char op;scan f(%f%c%f,&a, &op,&b);if(op=+)prin tf(%.2f%c%.2f=%.2fn,a,op,b,a+b);else if(op=-)prin tf(%.2f%c%.2f=%.2fn,a ,op,b,a-b);else if(op=*)prin tf(%.2f%c%.2f=%.2fn,a ,op,b,a*b);else if(op=/)if(b!=0)prin tf(%.2f%c%.2f=%.2fn ,a,op,b,a/b);elseprin tf(dat is0!Erro
9、r!n);elseprin tf(Error!n);Q3185 .(10分)實驗二(2016春劉秉權(quán)C語言課):根據(jù)輸入的百分制成 績score,轉(zhuǎn)換成相應(yīng)的五分制成績grade后輸出。轉(zhuǎn)換規(guī)則為(要求用switch語句實現(xiàn)):當(dāng)score大于等于90且小于等于100時,grade=A;當(dāng)score大于等于80且小于90時,grade=B;當(dāng)score大于等于70且小于80時,grade=C;當(dāng)score大于等于60且小于70時,grade=D;當(dāng)score大于等于0且小于60時,grade=E格式要求:輸入提示:Please en ter score:輸出形式形如:100-A、75-C、0-
10、E當(dāng)輸入分?jǐn)?shù)不正確時,輸出:In put error!II#in clude main ()int s,m;prin tf(Please en terscore:);scan f(%d, &s);m=s100?-1:s/10; switch(m)case 10:case9:pri ntf(%d-A n,s);break;case8:pri ntf(%d-Bn,s);break;case7:pri ntf(%d-Cn,s);break;case6:pri ntf(”d-Dn,s);break;case 5:case 4:case 3:case 2:case 1:case O:pri ntf (”
11、d-En,s);break;default:pri ntf(In put error!);Q221 .(10分)編程從鍵盤輸入某年某月(包括閏年),用 switch語句編程 輸出該年的該月?lián)碛械奶鞌?shù)。要求考慮閏年以及輸入月份不在合法范圍內(nèi)的情 況。已知閏年的2月有29天,平年的2月有28天。*輸入格式要求:d, %d提示信息:Input year,month:* 輸出格式要求:31 daysn 29 daysn 28 daysn Input error!n程序運行示例如下:In put year,mo nth:2004,229 days#in clude mai n()int a, b;pri
12、n tf(I nput year,m on th:); scan f(%4d, %2d, &a, &b); switch (b)case 1:case 3:case 5:case 7:case 8:case 10:case 12:prin tf(31 daysn ”);break;case 4:case 6:case 9:case 11:prin tf(30 daysn ”);break;case 2:if (a% 4 = 0 & a % 100 != 0) | a %400 = 0)prin tf(29 daysn);elseprin tf(28 daysn);break;default:p
13、rin tf(I nput error! n);return 0;Q210(1。 分)第7章實驗任務(wù)1:所謂素數(shù)是指這個數(shù)只能被1和自身整除。要求在主函數(shù)輸入一個數(shù), 調(diào)用函數(shù)Fun()判斷該數(shù)是否是素數(shù)。打印信息在主函數(shù)中進(jìn)行。例如:從鍵盤輸入5,5是素數(shù)則打印如下信息:5 is a prime number.又如:從鍵盤輸入4, 4不是素數(shù)則打印如下信息:4 is not a prime number負(fù)數(shù)、0和1均不是素數(shù)。對輸入的數(shù)據(jù)要考慮數(shù)據(jù)的合法性,不滿足條件的數(shù)要重新輸入直到滿足條件為止。不能使用全局變量,不按給定的函數(shù)原型編寫程 序不給分。Fun()函數(shù)原型如下:int Fun
14、(i nt m);* 輸入數(shù)據(jù)提示信息:Please in put a number:n注:該提示信息請放在循環(huán)體外*輸入數(shù)據(jù)格式為:%d*輸出格式要求:若是素數(shù)輸出數(shù)據(jù)格式為:d is a prime numbern若不是素數(shù)輸出數(shù)據(jù)格式為:%d is not a prime numbern#in elude #in elude int Fun (i nt m);main ()int a;prin tf(Please in put a nu mber:n);while (sea nf(%d,&a)if (a 0 &a != 1 &Fun(a) =1)prin tf(%d is a prime
15、nu mber n,a);elseprin tf(%d is not a prime nu mber n, a);break;return 0; int Fun (i nt m)int i, result;result = 1;if (m != 2)for (i = 2; i m; i+)if (m % i = 0)result = 0;break;return result;:根據(jù)輸入的百分制成Q3185 .(10分)實驗二(2016春劉秉權(quán)C語言課)績score,轉(zhuǎn)換成相應(yīng)的五分制成績grade后輸出。轉(zhuǎn)換規(guī)則為(要求用switch語句實現(xiàn)):當(dāng)score大于等于90且小于等于100時,g
16、rade=A;當(dāng)score大于等于80且小于90時,grade=B;當(dāng)score大于等于70且小于80時,grade=C;當(dāng)score大于等于60且小于70時,grade=D;當(dāng)score大于等于0且小于60時,grade=E。格式要求:輸入提示:Please en ter score:輸出形式形如:100-A、75-C、0-E當(dāng)輸入分?jǐn)?shù)不正確時,輸出:In put error!II#in clude main ()int s,m;prin tf(Please en terscore:);scan f(%d, &s);m=s100?-1:s/10; switch(m)case 10:case9
17、:pri ntf(%d-A n,s);break;case8:pri ntf(%d-Bn,s);break;case7:pri ntf(%d-Cn,s);break;case6:pri ntf(”d-Dn,s);break;case 5:case 4:case 3:case 2:case 1:case O:pri ntf(”d-En ,s);break;default:pri ntf(In put error!);Q1709(1。 分)第6章實驗1:國王的許諾相傳國際象棋是古印度舍罕王的宰相達(dá)依爾發(fā)明的。舍罕王十分喜歡象棋,決定讓宰相自己選擇何種賞賜。這位聰明的宰相指著8X 8共64格的象棋盤
18、說:陛下, 請您賞給我一些麥子吧,就在棋盤的第1個格子中放1粒,第2格中放2粒,第 3格中放4粒,以后每一格都比前一格增加一倍,依此放完棋盤上的64個格子,我就感恩不盡了。舍罕王讓人扛來一袋麥子,他要兌現(xiàn)他的許諾。請問:國王能 兌現(xiàn)他的許諾嗎?試編程計算舍罕王共要多少麥子賞賜他的宰相,這些麥子合多少立方米(已知1立方米麥子約粒)?注:(1)不能使用指針、結(jié)構(gòu)體、共用體、文件、goto、枚舉類型進(jìn)行編程。(2) 用標(biāo)準(zhǔn)C語言編程,所有變量必須在第一條可執(zhí)行語句前定義。(3) 輸入輸出格式要和以下給定格式完全一致。*輸入格式:無*輸出格式:sum = %envolum = %en%e表示doubl
19、e類型#in clude#in clude main ()int i;double s, v;s = 0;for (i = 0; i = 63;i+)s = s +pow(2, i);v = s / ;prin tf(sum=%en, s);prin tf(volum=%en, v);return 0;Q1719 .(10分)第7章實驗任務(wù)31n之間的所有素數(shù)之和從鍵盤任意輸入一個整數(shù)n,編程計算并輸出輸入提示信息:In put n:輸入格式:%d輸出格式:sum = %dn#in clude #in clude int Fun (i nt m);mai n()int n ,i,s;s=0;p
20、rintf(Inputn:);scanf(%d,&n);for(i=2;i=n;i+)if(Fun(i)=1)s=s+i;printf(sum= %dn,s);return 0;int Fun(int m)int i, result; result = 1; if (m != 2) for (i =2; i m; i+)if (m % i = 0)result = 0;break;retur n result;Q1720 分)第7章實驗任務(wù)6從鍵盤任意輸入一個整數(shù) m若m不是素數(shù),則對m進(jìn)行質(zhì)因數(shù)分解,并將 m表 示為質(zhì)因數(shù)從小到大順序排列的乘積形式輸出,否則輸出It is a primenu
21、mber0例如,用戶輸入90時,程序輸出90 = 2 * 3 * 3 * 5 ;用戶輸入17 時,程序輸出It is a prime number。輸入提示信息:In put m:輸入格式:%d輸出格式:是素數(shù)時輸出It is a prime numbern否則輸出用%d = , %d * 運行示例1:In put m:90 /90 = 2 * 3 * 3 * 5運行示例2:In put m:13 /It is a prime nu mber#in clude int Fun (i nt m);int IsPerfect(i nt m);main ()int m,i,p;prin tf(I n
22、put m:);scanf(%d,&m);p=m;if(Fun(m)=1)printf(It is a prime numbern);elseprintf(%d = ,m);for(i=2;im;i+)if(p%IsPerfect(i)=0&p/IsPerfect(i)!=1&IsPerfect(i)!=1)printf(%d * ,i);elseif(p%IsPerfect(i)=0&p/IsPerfect(i)=1&IsPerfect(i)!=1)printf(%d,i);break;elsecontinue;p=p/i;while(p%i=0)if(p/i!=1)printf(%d *
23、,i);p=p/i;elseprintf(%d,i);break;return 0;int Fun(int m) int i, result;result = 1;if (m != 2)for (i = 2; i m; i+)if (m % i = 0)result = 0; break;return result;int IsPerfect(int m)int i, result; result=1; if (m != 2) for (i = 2; i = m; i+) if (m % i = 0) break;else if(m%i!=1&m/i!=1) continue;else res
24、ult=m; elseresult=2;retur n result;Q198(i。 分)第7章實驗任務(wù)5如果一個正整數(shù)m的所有小于m的不同因子(包括1)加起來正好等于 m本身, 那么就被稱它為完全數(shù)。它是指這樣的一些特殊的自然數(shù),它所有的真因子(即 除了自身以外的約數(shù))的和,恰好等于它本身。注意:1沒有真因子,所以不是完全數(shù)。例如,6就是一個完全數(shù),是因為6 = 1 + 2 + 3 o請編寫一個判斷完全數(shù)的函數(shù)lsPerfect(),然后判斷從鍵盤輸入的整數(shù)是否是 完全數(shù)。|要求:按如下原型編寫判斷完全數(shù)的函數(shù),若函數(shù)返回0,則代表不是完全數(shù),若返回1,則代表是完全數(shù)。int IsPerfe
25、ct(i nt x);*要求輸入提示信息為:Input m:n*要求輸入格式為:d*要求輸出格式為%d is a perfect nu mber n%d is not a perfect nu mber n注:不能使用指針、結(jié)構(gòu)體、共用體、文件、goto、枚舉類型進(jìn)行編程,主函數(shù) 不能使用int main 和return 0 。#in clude int IsPerfect(i nt m);main ()int a;prin tf(I nput m:n);scanf(%d, &a);if (IsPerfect(a) = 1)prin tf(%d is a perfectnu mber n, a
26、);elseprin tf(%d is not a perfect nu mber n, a); int IsPerfect(i nt m)int i, s, find;s = 0;for (i = 1; i m; i+)if (m % i = 0)s = s + i;elsecon ti nue;if (s = m)find = 1;elsefind = 0;retur n find;Q3168(i。 分)編程從鍵盤輸入一個小寫英文字母,將其轉(zhuǎn)換為大寫英文 字母,并將轉(zhuǎn)換后的大寫英文字母及其十進(jìn)制的ASCII碼值顯示到屏幕上。* 輸入提示信息 * : Please in put a low-
27、case letter from keyboard:*輸入數(shù)據(jù)格式* : %c* 輸出數(shù)據(jù)格式 * : The capital letter and its ASCII value are:%c and %d.#in clude main ()char a;prin tf(Please in put a low-case letter from keyboard:); a = getchar();a = a - 32;prin tf(The capital letter and its ASCII value are:%cand %d., a, a);Q3241/10分)實驗三(2016春劉秉
28、權(quán)C語言課):已知公式e = 1 + 1/1!+ 1/2! + 1/3! + . +1/n!,編程計算e的近似值,直到最后一項的絕對值小于1e-7時為止,輸入e的值并統(tǒng)計累加的項數(shù)。要求:按順序輸出每一個e值, 小數(shù)點后保留8位有效數(shù)字,輸出格式形如:e = 2., count = 4 (回車換行, count為累加的項數(shù))#in clude double fun (i nt n);main ()int i, c;double e;c = 0;e = 0;for (i = 0; i=11; i+)e = e + fun (i);c+;printf(e = %.8lf, cou nt=%dn,
29、e, c);double fun (i nt n)double result;int i;i = 1;result = 1;doresult = result * i;i+;while (i = n);result = / result;return result;Q1710 .(10分)第7章實驗任務(wù)4:1和自身的因子;否任意輸入一個整數(shù)m若m不是素數(shù),則輸出其所有不包括 則輸出“沒有因子,是素數(shù)”的相關(guān)提示信息。輸入提示信息:Please en ter a number:輸入格式:%d輸出格式:有因子時:%dn無因子時:It is a prime divisor!n輸入為 1, 0,-1
30、時:It is not a prime divisor!n#in clude#in clude int Fun (i nt m);main()int a, i;printf(Please enter a number:);scanf(%d, &a);if (Fun(fabs(a) = 1) printf(It is a prime divisor!n);elsefor (i = 2; i fabs(a); i+)if ( a % i = 0) printf(%dn , i);int Fun(int m)int i, result;result = 1;if (m != 2 & m != 1)f
31、or (i = 2; i m; i+)if (m % i = 0)result = 0; break;else if (m = 1)result = 0;else;retur n result;Q1718 .(10分)第5章實驗1:身高預(yù)測。每個做父母的都關(guān)心自己孩子成人后的身高,據(jù)有關(guān)生理衛(wèi)生知識與數(shù)理統(tǒng)計分析表明,影響小孩成人后的身高的因素包括遺傳、 飲食習(xí)慣與體育鍛煉等。小孩 成人后的身高與其父母的身高和自身的性別密切相關(guān)。設(shè)faHeight為其父身高,moHeight為其母身高,身高預(yù)測公式為男性成人時身高 =(faHeight + moHeight)x cm女性成人時身高 =(faH
32、eightx + moHeight) / 2 cm此外,如果喜愛體育鍛煉,那么可增加身高 2%如果有良好的衛(wèi)生飲食習(xí)慣, 那么可增加身高%請編程從鍵盤輸入用戶的性別(用字符型變量sex存儲,輸入字符F表示女性,輸入字符M表示男性)、父母身高(用實型變量存儲,faHeight為其父身高, moHeight為其母身高)、是否喜愛體育鍛煉(用字符型變量sports存儲,輸入字符丫表示喜愛,輸入字符N表示不喜愛)、是否有良好的飲食習(xí)慣等條件(用 字符型變量diet存儲,輸入字符丫表示良好,輸入字符N表示不好),利用給 定公式和身高預(yù)測方法對身高進(jìn)行預(yù)測。運行示例:Are you a boy(M) or
33、 a girl(F)?F /Please in put your fathers height(cm):182/Please in put your mothers height(cm):162 /Do you like sports(Y/N)?N /Do you have a good habit of diet(Y/N)?Y /Your future height will be 167(cm)#in cludemai n() float fh, mh, h; char sex, sports, diet;printf(Are you a boy(M) or a girl(F)?); se
34、x = getchar();getchar();printf(Please input your fathers height(cm):);scanf(%f, &fh);getchar();printf(Please input your mothers height(cm):);scanf(%f, &mh);getchar();printf(Do you like sports(Y/N)?); sports = getchar();getchar();printf(Do you have a good habit of diet(Y/N)?);diet = getchar();if (sex
35、 = M)h = (fh + mh) * ;else if (sex = F)h = (fh * + mh) / 2;elseprintf(Error!n); goto R;if (sports = Y) h = h * ;else if (sports = N); elseprin tf(Error!n);goto R;if (diet = Y)h = h * ;else if (diet = N);elseprin tf(Error!n);goto R;prin tf(Your future height willbe %.0f(cm)n, h);R:return 0;Q3134.(.(1
36、0分)第8章實驗1:學(xué)生成績管理系統(tǒng)某班有最多不超過30人(具體人數(shù)由鍵盤輸入)參加某門課程的考試,用一維 數(shù)組作函數(shù)參數(shù)編程實現(xiàn)如下學(xué)生成績管理:(1)錄入每個學(xué)生的學(xué)號和考試成績;(2)計算課程的總分和平均分;(3)按成績由高到低排出名次表;(4)按學(xué)號由小到大排出成績表;(5)按學(xué)號查詢學(xué)生排名及其考試成績;(6)按優(yōu)秀(90100)、良好(8089)、中等(7079)、及格(6069)、不 及格(059) 5個類別,統(tǒng)計每個類別的人數(shù)以及所占的百分比;(7) 輸出每個學(xué)生的學(xué)號、考試成績程序運行結(jié)果示例:In put stude nt nu mber( n 30):6/Man agem
37、e nt for Stude nts scores recordtotal and average score of course in desce nding order by score in asce nding order by nu mber by nu mber an alysisrecordPlease In put your choice:1/In put stude nts ID, n ame and score:87 /98 /75 /48 /65 /Man ageme nt for Stude nts scores recordtotal and average scor
38、e of course in desce nding order by score in asce nding order by nu mber by nu mberan alysisrecordPlease In put your choice:2/sum=473,aver=Man ageme nt for Stude nts scores recordtotal and average score of course in desce nding order by score in asce nding order by nu mber by nu mberan alysisrecordP
39、lease In put your choice:Sort in desce nding order by score:1009887756548Man ageme nt for Stude nts scores recordtotal and average score of course in desce nding order by score in asce nding order by nu mber by nu mber an alysisrecordPlease In put your choice:4/Sort in asce nding order by nu mber:87
40、4898100Man ageme nt for Stude nts scores recordtotal and average score of coursein desce nding order by scorein asce nding order by nu mberby nu mberan alysisrecordPlease In put your choice:5/In put the nu mber you want to search:65Man ageme nt for Stude nts scores recordtotal and average score of c
41、oursein desce nding order by scorein asce nding order by nu mberby nu mberan alysisrecordPlease In put your choice:6/601%60-691%70-791%80-891%90-991%1001%Man ageme nt for Stude nts scores recordtotal and average score of course in desce nding order by score in asce nding order by nu mber by nu mber
42、an alysisrecordPlease In put your choice:756598100Man ageme nt for Stude nts scores recordtotal and average score of course in desce nding order by score in asce nding order by nu mber by nu mber an alysisrecordPlease In put your choice:8/In put error!Man ageme nt for Stude nts scores recordtotal an
43、d average score of course in desce nding order by score in asce nding order by nu mber by nu mber an alysisrecordPlease In put your choice:0/End of program!輸入格式:(1 )錄入學(xué)生的人數(shù):*輸入數(shù)據(jù)格式:%d*提示信息:Input student number(n30):n(2 )錄入每個學(xué)生的學(xué)號和考試成績:*輸入數(shù)據(jù)格式:ld%f*提示信息:I nput stude nts ID, n ame and score:n輸出格式:菜單項的
44、輸出顯示:Man ageme nt for Stude nts scores recordtotal and average score of course in desce nding order by score in asce nding order by nu mber by nu mberan alysisrecordPlease In put your choice:計算課程的總分和平均分:*輸出總分與平均分格式:sum=%.0f,aver=%.2fn按成績由高到低排出名次表:*輸出格式:%ldt%.0fn*提示信息:Sort in desce nding order by sco
45、re: n按學(xué)號由小到大排出成績表:*輸出格式:%ldt%.0fn*提示信息:Sort in asce nding order by nu mber:n按學(xué)號查詢學(xué)生排名及其考試成績:*如果未查到此學(xué)號的學(xué)生,提示信息:Not foun d!n*如果查詢到該學(xué)生,輸出格式:%ldt%.0fn按優(yōu)秀(90100)、良好(8089)、中等(7079)、及格(6069)、不及格(059)5個類別,統(tǒng)計每個類別的人數(shù)以及所占的百分比:*成績 60 輸出格式:60t%dt%.2f%n*成績=100 輸出格式:%dt%dt%.2f%n*其他輸出百分比格式:%d-%dt%dt%.2f%n#in clude#
46、in clude#defi ne N 30main ()int n ,i,j,temp1,temp2,choice,p,mark;long ids;float sum;printf(Input student number(n30):n);while(scanf(%d,&n)if(n0)break;elseprintf(Invalid Input!); continue;long idN;float scoreN;Choice:printf(Management for Students scoresn); printf( recordn);printf( total and average
47、score of coursen); printf( in descending order by scoren); printf( in ascending order by numbern); printf( by numbern);printf( analysisn);printf( recordn);printf(n); printf(Please Input your choice:n);scanf(%d,&choice); getchar();switch(choice)case 1:goto a;case2:goto b;case3:goto c;case4:goto d;cas
48、e5:goto e;case6:goto f;case7:goto g;case0:goto end;default:printf(Input error!n);goto Choice;a:printf(Input students ID, name and score:n);for(i=1;i=n;i+)scanf(%ld %f,&idi,&scorei);getchar();goto Choice;b:sum=0;for(i=1;i=n;i+)sum=sum+scorei;printf(sum=%.0f,aver=%.2fn,sum,sum/n);goto Choice;c:printf(Sort in descending order by score:n);for(i=1;in;i+)for(j=i+1;jscorei)temp1=scorei,temp2
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 家具行業(yè)設(shè)計中DIY文化的影響試題及答案
- 小學(xué)教師反思教育過程中的創(chuàng)新思維試題及答案
- 物理推理性試題及答案
- 幼兒園有趣的數(shù)學(xué)題目解析試題及答案
- 施工現(xiàn)場安全保障措施與效果考題探討試題及答案
- 小學(xué)教育中的反思與調(diào)整方法試題及答案
- 未來電動車的市場驅(qū)動因素分析試題及答案
- 五年級數(shù)學(xué)(小數(shù)四則混合運算)計算題專項練習(xí)及答案匯編
- 《蔬菜世界》課件
- 動力電池技術(shù)革新的實踐與應(yīng)用試題及答案
- 2022年國家開放大學(xué)《當(dāng)代中國政治制度》形考任務(wù)1-4答案(全)
- 給水管線改移工程施工方案
- 甲醛車間工藝介紹資料
- 中小學(xué)生心理健康診斷測驗MHT(附測試量表及評分細(xì)則)
- GB/T 10612-2003工業(yè)用篩板板厚
- XBRL原理及四步法課件
- 中醫(yī)治未病課件
- 建筑物理-采光設(shè)計課件
- DB32-T 2355-2022 綜合交通建設(shè)試驗檢測用表編制規(guī)范(修)
- 八年級體育教案(全冊)
- 2022新高考卷小說《江上》 答案+評點
評論
0/150
提交評論