fork download
  1. #include <stdio.h>
  2. int absolute(int a){
  3. if (a < 0)
  4. a = -a;
  5. return a;
  6. }
  7. int main(void) {
  8. int a,b;
  9. a = -3;
  10. b = absolute(a);
  11. printf("%d の絶対値は %d", a,b);
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
-3 の絶対値は 3