fork download
  1. #include <stdio.h>
  2. int calc(int x){
  3. int i,a=1;
  4. for(i=0;i<x;i++)
  5. a = a*3;
  6. return a;
  7.  
  8.  
  9. }
  10. int main(void) {
  11. int s,t;
  12. scanf("%d,%d",&s,&t);
  13. printf("3の%d乗は%d\n3の%d乗は%d",s,calc(s),t,calc(t));
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 5320KB
stdin
2,
4
stdout
3の2乗は9
3の4乗は81