版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領
文檔簡介
1、精選優(yōu)質(zhì)文檔-傾情為你奉上 程序填空題1、#include <stdio.h>void main() int n,k=0; scanf("%d",&n);while( _1_ ) / 1)n 2) n!=0; k+; _2_; n=n/10 printf("%dn",k);2、#include <stdio.h>#include <math.h>#define f(x) x*x-5*x+sin(x)void main() int x; float max; _1_ / max=f(1); for(x=2;x&l
2、t;=10;x+) _2_ / if(f(i)>max) max=f(i); printf("%fn",max);3、#include <stdio.h>void main() char c; c=getchar(); if(_1_) / c>='a' && c<'v' c=c+5; else if (c>='v' && c<='z') _2_ /c=c-21; putchar(c);4、#include <stdio.h>v
3、oid Dec2Bin(int m) int bin32,j; for(j=0;m!=0;j+) binj= _1_; / m%2 m=m/2; for(;j!=0;j-) printf("%d", _2_ ); / binj-1void main() int n; scanf("%d",&n); Dec2Bin(n);5、#include <stdio.h> #include <math.h> void main() int n,s=0; scanf("%d",&n); _ 1 _ /n=(n
4、>0?n:-n) ; 2)n=fabs(n); while(n!=0) _ 2 _ / s=s+n%10; n=n/10; printf("%dn",s); 6、/#include <stdio.h>void swap(_1_) /int *pa , int *pb /*交換兩個數(shù)的位置*/ int temp; temp = *pa; *pa = *pb; *pb = temp;void main() int a,b,c,temp; scanf("%d%d%d",&a,&b,&c); if(a>b) swa
5、p(&a,&b); if(b>c) swap(&b,&c); if(_2_) / a>b swap(&a,&b); printf("%d,%d,%d",a,b,c);7、#include <stdio.h>_1_ /long f(int n);void main() printf("%ldn",f(30);long f(int n) if( _2_ ) / n=1|n=2 return 1; else return f(n-1)+f(n-2);8、#include <stdio
6、.h>void main() char s80; int i,j; gets(s); for(i=j=0;_1_;i+) / si!=0 if(si != 'c') sj=si; _2_ /j+; sj='0' puts(s);9、#include <stdio.h>struct STUDENT char name16; int math; int english; int computer; int average;void GetAverage(struct STUDENT *pst) /* 計算平均成績 */ int sum=0; sum
7、 = _1_; /sum+ pst->math+ pst->English+ pst->computer pst->average = sum/3;void main() int i; struct STUDENT st4="Jessica",98,95,90,"Mike",80,80,90, "Linda",87,76,70,"Peter",90,100,99; for(i=0;i<4;i+) GetAverage(_2_); / &sti printf("Name
8、tMathtEnglishtComputAveragen"); for(i=0;i<4;i+) printf("%st%dt%dt%dt%dn",,sti.math,sti.english, puter,sti.average); 10、#include <stdio.h>#include <math.h>long f(long n) long m,y=0; m=fabs(n); while(m!=0) y=y*10+m%10; _1_ / m=m/10; if(n>=0) return y; el
9、se _2_ / return ( -y);void main() printf("%ldt",f(12345); printf("%ldn",f(-34567);11、#include <stdio.h>float f(float,float*,int);void main() float b5=1.1,2.2,3.3,4.4,5.5; printf("%fn",f(1.7,b,5);float f( _1_ ) / float x,float a , int n float y=a0,t=1; int i; for(i
10、=1;i<n;i+) t=t*x; y=y+ai*t; _2_ / return y 12、#include <stdio.h>#include <string.h>#include <ctype.h>void f(char *s) int i=0; while(si!='0') if(isdigit(si) _1_(s+i,s+i+1); / strcpy _2_ i+; / elsevoid main() char str80; gets(str); f(str); puts(str);13、#include <stdio.h
11、>#include <ctype.h>void main() char a80; int n3=0,i; gets(a); _1_ /for(i=0;ai!=0;i+) if (tolower(ai)>='a' && tolower(ai)<='z') /*統(tǒng)計字母個數(shù)*/ n0+; else if (_2_) /*統(tǒng)計數(shù)字個數(shù)*/ ai>='0' && ai<='9'n1+; else n2+; for(i=0;i<3;i+) printf(&quo
12、t;%dn",ni); 14、#include <stdio.h>#include<math.h>void main()int i,a,b,c;for(i=100;i<=999;i+)a=i/100;_1_ / b=i%100/10;c=i%10;if (_2_) /i=a*a*a+b*b*b+c*c*cprintf("%d is a Armstrong number!n",i);15、#include <stdio.h>void main() int a10,b10,i; printf("nInput 10 numbers: "); for (i=0; i<10;i+) /* 數(shù)組輸入 */ scanf(&qu
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度南京二手房交易稅費減免政策咨詢合同
- 二零二五年度農(nóng)田租賃與農(nóng)業(yè)金融服務合同樣本
- 2025年度瓶裝純凈水原水采集與處理合同4篇
- 2025年度門面房屋租賃合同租賃雙方信息保密協(xié)議4篇
- 2025年度海洋工程技術服務合同協(xié)議范本3篇
- 民政局二零二五年度離婚協(xié)議書電子模板使用許可4篇
- 二零二五版金融信息服務合同4篇
- 2025年度個人店面租賃合同范本簡易版2篇
- 2025年度個人房產(chǎn)買賣合同法律咨詢協(xié)議2篇
- 2025年度個人網(wǎng)絡安全與隱私保護咨詢服務合同范本3篇
- 圖形的位似課件
- 醫(yī)院急診醫(yī)學小講課課件:急診呼吸衰竭的處理
- 腸梗阻導管在臨床中的使用及護理課件
- 調(diào)料廠工作管理制度
- 2023年MRI技術操作規(guī)范
- 小學英語單詞匯總大全打印
- 衛(wèi)生健康系統(tǒng)安全生產(chǎn)隱患全面排查
- GB/T 15114-2023鋁合金壓鑄件
- 三相分離器原理及操作
- 貨物驗收單表格模板
- 600字A4標準作文紙
評論
0/150
提交評論