分类: C/C++
2014-11-27 19:25:01
我的第一个
c语言程序
/*This is a test program */
/*This program was written by LiuJiaFeng .*/
/*Modified in 2013 10 15 .*/
#include
Int man()
{
printf(“very good \n\n”);
getcher();
return 0;
}我的第二个c语言程序
/* This is a test program */
/* This program was written by LiuJiaFeng. */
/* Modified in 2013 10 16 */
#include
int main()
{
float h,r,l,s, sq,vq,vz;
float pi=3.1415926;
printf("please input the radius r, cylindrical high.\n");
scanf("%f,%f",&r,&h);
l = 2 * pi * r ;
s = r * r * pi ;
sq = 4 * pi * r * r;
vq = 3.0/4.0 * pi * r * r * r;
vz = pi * r * r * h;
printf("The perimeter of a circle is : l = %6.2f \n",l);
printf("The area of a circle is : s= %6.2f \n",s);
printf("Spherical surface area is : sq = %6.2f \n",sq);
printf("Ball size is : v = %6.2f \n",vq);
printf("Cylindrical volume is : vz = %6.2f \n",vz);
getchar();
return 0 ;
}
/* This is a test program */
/* This program was written by LiuJiaFeng. */
/* Modified in 2013 10 16 */
#include
int main()
{
float x, y1, y2, y3, y4, y5, y6, y7, y8;
printf("please input the x and y .\n");
scanf("%f",&x);
y1 = x+ 1 ;
y2 = x * x + 2 ;
y3 = x * x * x + 3 ;
y4 = x * x * x * x + 4 ;
y5 = x * x * x * x * x + 5 ;
y6 = x * x * x * x * x * x + 6 ;
y7 = x * x * x * x * x * x * x + 7 ;
y8 = x * x * x * x * x * x * x * x + 8;
printf("yi ci fang cheng : y1 = %6.2f \n",y1);
printf("er ci fang cheng : y2 = %6.2f \n",y2);
printf("san ci fang cheng :y3 = %6.2f \n",y3);
printf("si ci fang cheng : y4= %6.2f \n",y4);
printf("wu ci fang cheng : y5 = %6.2f \n",y5);
printf("liu ci fang cheng : y6= %6.2f \n",y6);
printf("qi ci fang cheng : y7 = %6.2f \n",y7);
printf("ba ci fang cheng : y8= %6.2f \n",y8);
return 0 ;
}