fork download
  1. #include <stdio.h>
  2. //練習問題C
  3. int sum(int m, int n){
  4. return m+n;
  5. }
  6. int func(int n){
  7. if (n < 0){
  8. n = -n;
  9. }
  10. return n;
  11. }
  12.  
  13. int main(void) {
  14. int n = -2, m = 3;
  15. printf("%dの絶対値と%dの絶対値和は%d\n", m,n,sum(func(m),func(n)));
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0.01s 5296KB
stdin
Standard input is empty
stdout
3の絶対値と-2の絶対値和は5