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