C语言程序:计算几何图形面积和高度
#include<stdio.h> #include<math.h> int main() { int n; float s,m,i,h=0.0; scanf("%d%f",&n,&m); h=n; for(i=0;i<m;i++) { h=h/4; } for(i=0;i<m-1;i++) { s=s+2*(n/pow(4,i+1)); } s=s+n; printf("s = %.2f\n",s); printf("h = %.2f",h); }
原文地址: https://www.cveoy.top/t/topic/pfKB 著作权归作者所有。请勿转载和采集!