#includeusing namespace std;int judge(int a);int main(){int n,t;cout << "请输入一个整数:" << endl;cin >> n;t=judge(n);switch (t){case 1:cout << "能被3整除" << endl; break;case 3:cout << "能被5整除" << endl; break;case 5:cout << "能被7整除" << endl; break;case 4:cout << "能被3和5整除" << endl; break;case 6:cout << "能被3和7整除" << endl; break;case 8:cout << "能被5和7整除" << endl; break;case 9:cout << "能被3、5和7整除" << endl; break;default:cout << "不可以被3、5和7整除" << endl;}system("pause");}int judge(int a){int t = 0;if (a % 3 == 0)t = 1;if (a % 5 == 0)t = t + 3;if (a % 7 == 0)t = t + 5;return t;}