fork download
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5. int no, abs;
  6.  
  7. printf("数値を入力してください。: ");
  8. scanf("%d", &no);
  9.  
  10. abs = (no >= 0) ? no : -no;
  11.  
  12. printf("絶対値は %d です。: ");
  13.  
  14. return 0;
  15. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
数値を入力してください。: 絶対値は 1779766672 です。: