[工学]C语言课程的一些答案.docVIP

  • 3
  • 0
  • 约2.32万字
  • 约 40页
  • 2018-03-10 发布于浙江
  • 举报
[工学]C语言课程的一些答案

1-1 #includestdio.h #includemath.h void main() { int a=3,b=4,c=5; float s; float l; l=(a+b+c)/2.0; s=sqrt(l*(l-a)*(l-b)*(l-c)); printf(s=%f\n,s); } 1-2 #includestdio.h void main() { int h,f; int x; int y; scanf(%d%d,h,f); x=(f-2*h)/2; y=(4*h-f)/2; printf(x=%d,y=%d\n,x,y); } 1-3 #includestdio.h void main() { int r,h; float l,s1,s2,v1,v2; scanf(%d%d,r,h); l=3.14*2*r; s1=3.14*r*r; s2=4*3.14*r*r; v1=3.14*r*r*h; v2=4*3.14*r*r*r/3; printf(l=%f,s1=%f,s2=%f,v1=%f,v2=%f\n,l,s1,s2,v1,v2); } 1-4 #includestdio.h void main() { int F; float c; scanf(%d,F); c=5.0/9*(F-32); printf

文档评论(0)

1亿VIP精品文档

相关文档