fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. int i;
  6. scanf("%d",&i);
  7. if(i%2==0&&i%3==0){
  8. printf("%dは2でも3でも割り切れます",i);
  9. }
  10. else if(i%2==0&&i%3!=0){
  11. printf("%dは2で割り切れ3で割りきれません",i);
  12. }
  13. else if(i%2!=0&&i%3!=0){
  14. printf("%dは2でも3でも割り切れません",i);
  15. }
  16.  
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0.01s 5308KB
stdin
16
stdout
16は2で割り切れ3で割りきれません