吴鹏的博客
1. 求摄氏温度26度对应的华氏温度,计算公式为:F=(9/5)C+32,式中:C表示摄氏温度,F表示华氏温度。
2. 输入圆的半径r,圆柱体的高h,分别计算圆周长、面积、圆柱体的体积。
3. 读入一个字符,输出与之对应的ASCII码,输入输出有相应的文字说明。
Tags: c, 调试程序 Views:1508
C
Comments
3/10/2008 6:38:54 AM #
答案如下:仅供参考 1. #include <stdio.h> main() { float c; float f; printf("Input a value:"); scanf("%f",&c); f=(9.0/5)*c+32; printf("%f\n",f); } 2. #include <stdio.h> #define PI 3.14159 void main() { float r,h; float l,s,v; printf("Input two values like this:1.2,2.3\n"); scanf("%f,%f",&r,&h); l=2*PI*r; s=PI*r*r; v=PI*r*r*h; printf("l=%f,s=%f,v=%f\n",l,s,v); } 3. #include <stdio.h> void main() { char c; printf("Input a char:"); scanf("%c",&c); printf("The ASCII of the char '%c' is:%d\n",c,c); }
吴鹏 |
Powered by BlogEngine.NET 1.5.0.7 Theme by Mads Kristensen 浙ICP备09023819号
1.男 2.已婚 3.网虫 4.宝宝叫yoyo