早教吧 育儿知识 作业答案 考试题库 百科 知识分享

、判断用户输入的整数能否被2,3,5整除,并根据情况输出以下信息之一:1)能同时被2,3,5整除.2)能被其中两个(哪两个)数整除.3)能被其中一个(哪一个)数整除.4)不能被2,3,5中的任一个

题目详情
、判断用户输入的整数能否被2,3,5整除,并根据情况输出以下信息之一:
1)能同时被2,3,5整除.
2)能被其中两个(哪两个)数整除.
3)能被其中一个(哪一个)数整除.
4)不能被2,3,5中的任一个数整除.
▼优质解答
答案和解析
#include "stdio.h"main(){int i,a;printf("input the number:");scanf("%d",&a);if(!((a%2)||(a%3)||(a%5)))printf(" %d can be divided with no remainder by 2,3 and 5.",a);else if((a%2==0)&&(a%3==0)&&(a%5!=0...