fork(1) download
  1. #include <stdio.h>
  2. double power(double x,int n){
  3. double p=1;
  4. int i;
  5. for(i=1;i<=n;i++)
  6. p=p*n;
  7. return p;
  8. }
  9. int main(void) {
  10. double a;
  11. int b;
  12. int m;
  13. scanf("%d%d\n",&a,&b);
  14. m=power(a,b);
  15. printf("%d的%d次方是:%d",a,b,m);
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 5360KB
stdin
3  2
stdout
2的4次方是:-492451647