- 22
- 0
- 约6.98千字
- 约 2页
- 2017-05-02 发布于广东
- 举报
编程7:输入三个实数,按代数值由小到大的顺序输出
#includestdio.h
int main()
{
int a,b,c;
int temp;
scanf(%d%d%d,a,b,c);
if(ab)
{
temp=a;
a=b;
b=temp;
}
if(ac)
{
temp=a;
a=c;
c=temp;
}
if(bc)
{
temp=b;
b=c;
c=temp;
}
printf(排列后a=%d,b=%d,c=%d\n,a,b,c);
return 0;
}
编程8:求1到100的和
#include stdio.hint main(){int i,sum=0; i=1; while (i=100) { sum=sum+i; i++; } printf(″%d\n″,sum); return 0; }
编程1-程序4.1 从键盘上输入a,b,c的值,并以它们为三角形的三条边,求三角形的面积。
#include stdio.h
#include math.h //包含了函数sqrt原型
int main( )
{
double a,b,c,s,area;
printf(Please
原创力文档

文档评论(0)