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