第5章复习题参考答案.docVIP

  • 6
  • 0
  • 约2.12千字
  • 约 5页
  • 2020-03-27 发布于安徽
  • 举报
《实用C语言简明教程》 第5章习题参考答案 5-1 D 5-2 B 5-3 (1) #include stdio.h main() { int i=0,a=0; while(i20) { for(;;) if(i%10==0) break; else i--; i+=11; a+=i; } printf(%d\n,a); } 输出结果:32 (2) #include stdio.h main() { int i,j,b=0; for(i=0;i3;i++) for(j=0;j2;j++) if(j=i) b++; printf(%d\n,b); } 输出结果:3 5-4 #include stdio.h main() { int s,n; s=0;n=0; while(s1000) {n++; s+=n*n;} printf(n=%d,s=%d\n,n-1,s-n*n); } 输出结果: n=13,s=819 5-5 #include stdio.h main() { int j, x, max, min, sum; float ave; printf(Enter 10 number:\n); scanf(%d,x); sum=max=min=x; for(j=2;j=10;j++) { scanf

文档评论(0)

1亿VIP精品文档

相关文档