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 = -19;
  10. b = absolute(a);
  11. printf("%dの絶対値は%d",a,b);
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 5332KB
stdin
Standard input is empty
stdout
-19の絶対値は19