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