fork download
  1. #include <stdio.h>
  2. int absolute(int x){
  3. if (x < 0)
  4. x = -x;
  5. return x;
  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 0s 5280KB
stdin
Standard input is empty
stdout
-3 の絶対値は 3