fork download
  1. #include <stdio.h>
  2.  
  3. #define sqr(x) (x * x)
  4. #define cub(x) (sqr(x) * x)
  5.  
  6. int main(void)
  7. {
  8. int i;
  9. double d;
  10.  
  11. printf("整数を入力してください : ");
  12. scanf("%d", &i);
  13. printf("その数の二乗は%dで\n三乗は%dです。\n\n", sqr(i), cub(i));
  14.  
  15. printf("実数を入力してください : ");
  16. scanf("%lf", &d);
  17. printf("その数の二乗は%lfで\n三乗は%lfです。\n", sqr(d), cub(d));
  18.  
  19. return 0;
  20. }
  21.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty