輸入一個圓柱體的高和半徑,計算其底面積和體積。
輸入一個圓柱體的高和半徑,計算其底面積和體積。
慕粉2149038396
2016-12-26 00:49:29
TA貢獻152條經驗 獲得超157個贊
#include?<stdio.h> #define?PI?3.14 int?main() { double?h,r; printf("請輸入圓柱體的高和半徑(數字之間用空格隔開):"); scanf("%lf%lf",?&h,&r); printf("圓柱體的底面積:%.2lf\n",?PI*r*r); printf("圓柱體的體積:%.2lf",?PI*r*r*h); }
舉報