https://www.cnblogs.com/longhai3/longhai


=======================================================

圆柱体的体积和表面积

#include<stdio.h>
#define PI 3.14
int main()
{
printf("圆柱体的底面半径值和高,输入'r=,h='\n计算圆柱体的体积和表面积\n");
float r,h,s,v;
scanf("r=%f,h=%f",&r,&h);
printf("底面半径值=%f\n高=%f\n",r,h);
v=PI*r*r*h;
s=2*PI*r*r+2*PI*r*h;
printf("体积=%f,\n表面积=%f",v,s);
return 0;
}


=======================================================

求和与平均值

#include<stdio.h>
int main()
{
float a,b,c,d;
scanf("%f%f",&a,&b);
printf("求和与平均值\n%f,%f\n",a,b);
c=a+b;
d=c/2;
printf("%.2f,%.2f",c,d);
return 0;
}

=======================================================

 

随心,随记

https://www.cnblogs.com/w1hg/331817