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