fork download
  1. #include <stdio.h>
  2.  
  3. //二つの値の和を返す関数
  4. int sum(int x, int y){
  5. return x+y;
  6.  
  7. }
  8.  
  9. //引数の三乗の値を返す関数
  10. int cube(int x){
  11. return x*x*x;
  12. }
  13.  
  14. //main関数
  15. int main(void) {
  16. int a,b,c;
  17. a=2;
  18. b=-3;
  19. c=cube(sum(a,b));
  20. printf("%dと%dの和を3乗した値は%d",a,b,c);
  21.  
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
2と-3の和を3乗した値は-1