fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a;
  5. scanf("%d",&a);
  6. if(a%6==0){
  7. printf("2の倍数でもあり3の倍数でもあります");
  8. }else if(a%3==0){
  9. printf("3の倍数です");
  10. }else if(a%2==0){
  11. printf("2の倍数です");
  12. }else
  13. printf("2の倍数でも3の倍数でもありません");
  14.  
  15.  
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0.01s 5316KB
stdin
12
stdout
2の倍数でもあり3の倍数でもあります