#includeint main(){ int i,n; double x,sum; printf("输入实数x和正整数n:"); scanf("%lf%d",&x,&n); sum=1; for(i=1;i<=n;i++){ sum=sum*x; } printf("x^n=%.2f\n",sum); return 0;}
本文共 260 字,大约阅读时间需要 1 分钟。
#includeint main(){ int i,n; double x,sum; printf("输入实数x和正整数n:"); scanf("%lf%d",&x,&n); sum=1; for(i=1;i<=n;i++){ sum=sum*x; } printf("x^n=%.2f\n",sum); return 0;}
转载于:https://www.cnblogs.com/reaper/p/3378745.html