fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a;
  5.  
  6. printf("整数を入力してください:");
  7. scanf("%d",&a);
  8.  
  9. if(a%2 == 0)
  10. {
  11. if(a%3 == 0)
  12. printf("6の倍数です。\n");
  13. else
  14. printf("2の倍数です。\n");
  15. }
  16. else if(a%3 == 0)
  17. {
  18. if(a%5 == 0)
  19. printf("15の倍数です。\n");
  20. else
  21. printf("3の倍数です。\n");
  22. }
  23. // your code goes here
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0.01s 5304KB
stdin
225
stdout
整数を入力してください:15の倍数です。