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 l, n = -2, m = 3;
  15. l =sum(func(m),func(n));
  16. printf("%dの絶対値と%dの絶対値和は%d\n", m,n,l);
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
3の絶対値と-2の絶対値和は5