C语言程序分析.ppt

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
C语言程序分析.ppt

* 程序分析 #include stdio.h main() { int i,j; for(i=0;i6;i++) for(j=1;j12;j++) { if(j==6) break; if(i3) continue; } printf(j=%d\n,j); printf(i=%d\n,i); getch(); } P56-1: P56-2: #include stdio.h main() {int i=5; do { switch(i%2) {case 1:i--;break; case 0:i--;continue; } i=i-2; printf(i=%d\n,i); }while (i0); getch(); } P56-3: #include stdio.h main() {int i,j; for(i=1;i5;i++) { for(j=1;j=i-1;j++) { printf( ); printf(***); } printf(\n); } getch(); } #include stdio.h main() { int n,num; scanf(%d,num); for(n=1;n=10;n++) {if(num0) printf(%d\n,num); scanf(%d,num); } getch(); } P57-4-1: P57-4-2: #include stdio.h main() { int f; float c; for(f=-10;f=290;f=f+10) { c=5.0/9*(f-32); printf(f=%d,c=%.2f\n,f,c); } getch(); } P57-4-3: #include stdio.h main() { float sum=0,i; for(i=3.0;i=41;i=i+2) { sum=sum+i/(i+2); } printf(%.2f,sum); getch(); } P57-4-4: #include stdio.h main() {int a=0,b=0,c=0; char ch; ch=getchar(); while(ch!=\n) { if((ch=ach=z)||(ch=Ach=Z)) a++; else if(ch=0ch=9) b++; else c++; ch=getchar(); } printf(“字母个数:%d,数字个数:%d,其它个数:%d\n,a,b,c); getch(); } P59: #include stdio.h main() { int i,j,k; i=k=1; while(i=10) { for(j=1;j=k;j++,i++) printf(%d,i%10); printf(\n); k++; } getch(); } P65-2: #include stdio.h main() { int s,i; for(s=0,i=1;i3;i++,s+=i); printf(%d\n,s); getch(); } P65-3: #include stdio.h main() { int x,y; for(y=1;y10;) y=((x=3*y,x+1),x-1); printf(x=%d,y=%d,x,y); getch(); } #include stdio.h main() { int i,j; for(i=0,j=3;i=j;i+=2,j--) printf(%d\n,i); getch(); } P69-1: #include stdio.h main() { int k=0; while(k10) { if(k1) continue; if(k==5) break; k++; } } P69-3: #include stdio.h main() { int k=2; while(k) printf(%d,k),k--; printf(\n); getch(); } P70-4: #include stdio.h main() { int sum=0,k,i; printf(please input k:); scanf(%d,k); for(i=1;i=k;i++) sum=sum+i*i; printf(%d\n,sum); getch(); } P65-4.1: P66-4

文档评论(0)

基本资料 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档