fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5.  
  6. int n1;
  7. puts("整数を入力してください:"); scanf("%d",&n1);
  8.  
  9. if(n1==8)
  10. puts("絶対値は8です。");
  11. else if(-n1==8)
  12. puts("絶対値は8です。");
  13.  
  14.  
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 9424KB
stdin
8
stdout
整数を入力してください:
絶対値は8です。