#include#include int main(void){ int n,i,power; double product; printf("Enter n:"); scanf("%d",&n); product=0; for(i=1;i<=n;i++){ power=pow(2,i); printf("%d",power); product=product+power; } printf("product=%.0f\n",product); return 0;}
本文共 373 字,大约阅读时间需要 1 分钟。
#include#include int main(void){ int n,i,power; double product; printf("Enter n:"); scanf("%d",&n); product=0; for(i=1;i<=n;i++){ power=pow(2,i); printf("%d",power); product=product+power; } printf("product=%.0f\n",product); return 0;}
转载于:https://www.cnblogs.com/simple9495/p/3378656.html