《C语言程序设计》(苏小红) 课后习题答案.docxVIP

  • 411
  • 1
  • 约1.94万字
  • 约 36页
  • 2018-11-03 发布于浙江
  • 举报

《C语言程序设计》(苏小红) 课后习题答案.docx

《C语言程序设计》(苏小红) 课后习题答案.docx

PAGE \* MERGEFORMAT1 2.2 #includestdio.h main() { float x=2.5,y=2.5,z=2.5; printf(x=%f\n,x); printf(y=%f\n,y); printf(z=%f\n,z); } 3.1(1) #includestdio.h main() { int a=12,b=3; float x=18.5,y=4.6; printf(%f\n,(float)(a*b)/2); printf(%d\n,(int)x%(int)y); } 3.1(2) #includestdio.h main() { int x=32,y=81,p,q; p=x++; q=--y; printf(%d %d\n,p,q); printf(%d %d\n,x,y); } 3.2 #includestdio.h main() { int x,b0,b1,b2,s; printf(Inputx:); scanf(%d,x); b2=x/100; b1=(x-b2*100)/10;//或(x%100)/10;或x/10%10; b0=x%10; s=b0*100+b1*10+b2; printf(s=%d\n,s); } 3.3 #includestdio.h #includemath.h main() { floa

文档评论(0)

1亿VIP精品文档

相关文档