fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3. f(a,b){int i=0,q=pow(a,b);while(q){i+=q%10;q/=10;}return i;}
  4.  
  5. int main(void) {
  6. printf("%d",f(9,4));
  7. return 0;
  8. }
  9.  
Success #stdin #stdout 0s 4348KB
stdin
Standard input is empty
stdout
18