第一次程序设计上机报告

来源:互联网 发布:学美容知乎 编辑:程序博客网 时间:2024/04/30 08:50
//**************************************//对 fahr=0,20,...300//打印华氏温度与摄氏温度对照表//code by  黄磊 120705102 2013.3.8//**************************************#include<stdio.h>int main(){int fahr,celsius;int lower,upper,step;lower=0;       /* 温度表的下限 */upper=300;     /* 温度表的上限 */step =20;       /* 步长 */fahr=lower;printf("黄磊,120705102\n","");while(fahr<=upper){celsius=5*(fahr-32)/9;printf("%d%d\n",fahr,celsius);        fahr=fahr+step;}return 0;}

运行结果1

 

//**************************************#include<stdio.h>int main(){int fahr,celsius;int lower,upper,step;lower=0;       /* 温度表的下限 */upper=300;     /* 温度表的上限 */step =20;       /* 步长 */fahr=lower;printf("黄磊,120705102\n","");while(fahr<=upper){celsius=5*(fahr-32)/9;printf("%d\t%d\n",fahr,celsius);        fahr=fahr+step;}return 0;}


运行结果2

 

总结:第一次看到自己完成的程序,非常的激动,虽然一开始毛手毛脚,完全看不懂,但是适应了之后就好了。总是还是十分开心的。

原创粉丝点击