fork download
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5. int a;
  6.  
  7. printf("整数値:%d\n"); scanf("%d", &a);
  8.  
  9. if ((a % 3) == 0)
  10. puts("この値は3で割り切れます。");
  11. else if ((a % 3) == 1)
  12. puts("この整数は3で割ると1余ります。");
  13. else
  14. puts("この整数は3で割ると2余ります。");
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 5320KB
stdin
4
stdout
整数値:-584358120
この整数は3で割ると1余ります。