Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- float h,r,c,s,sq,vq,vz;
- float pi = 3.1415265358979;
- printf("請輸入圓圓半徑r,圓圓柱高h:\n");
- scanf("%f,%f",&r,&h);
- c = 2 * pi*r;
- s = pi*r*r;
- sq = 4 * pi*r*r;
- vq = (4 / 3)*pi*r*r*r;
- vz = pi*r*r*h;
- printf("圓周長為:c=%4.2f\n",c);
- printf("圓面積為:s=%5.2f\n",s);
- printf("圓球表面積:sq=%5.2f\n", sq);
- printf("圓球體積為:vq=%5.2f\n", vq);
- printf("圓柱體積為:vz=%5.2f\n", vz);
- system("read -n1 -p \"press key to contiune\"");
- return 0;
- }
Add Comment
Please, Sign In to add comment