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