C语言基本编程题.docVIP

  • 38
  • 0
  • 约1.31万字
  • 约 17页
  • 2019-03-12 发布于江苏
  • 举报
WORD格式-专业学习资料-可编辑 PAGE 学习资料分享 复习题 C程序设计编程题 1.输入2个整数,求两数的平方和并输出。 #include stdio.h void main() { intt a ,b,s; printf(please input a,b:\n); scanf(%d%d”,a,b); s=a*a+b*b; printf(the result is %d\n,s); } 2. 输入一个圆半径(r),当r=0时,计算并输出圆的面积和周长,否则,输出提示信息。 #include stdio.h #define PI 3.14 void main() { float r ,s , l; printf(please input r:\n); scanf(%f”,r); if (r=0) {s=pi*r*r; l=2*i*r ; printf(the area is %f\n,s); printf(the circumference is %f\n,l);} else printf(input error!\n); } 3、函数y=f(x)可表示为:

文档评论(0)

1亿VIP精品文档

相关文档