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