//计算x的n的值,不许调用pow #include<stdio.h> int main(void) { int n,i; double x,y; y=1; printf("输入n,x:"); scanf("%d%Lf",&n,&x); for(i=1;i<=n;i++){ y=y*x; } printf("y=%Lf",y); return 0; }
//计算x的n的值,不许调用pow #include<stdio.h> int main(void) { int n,i; double x,y; y=1; printf("输入n,x:"); scanf("%d%Lf",&n,&x); for(i=1;i<=n;i++){ y=y*x; } printf("y=%Lf",y); return 0; }