#include

double pow(double x,int n)
{
 int i;
 double sum;
 sum=1;
 for(i=0;i {
  sum=sum*x;
 }
  return sum;
}
int main()
{
 double num;
 int n;
 scanf("%lf%d",&num, &n);          
 printf("%.2lf\n", pow(num,n));
 return 0;
}
如图:c语言之一个数的n次方-LMLPHP

12-22 05:46