- 4
- 0
- 约小于1千字
- 约 17页
- 2020-10-10 发布于广东
- 举报
C 程序设计编程题
输入 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);
}
输入一个圆半径(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)可表示为:
2
原创力文档

文档评论(0)