Karl 有 n 个正整数 a1,...,an,请你依次判断每一个数是否满足如下要求之一:
请你对每一个数进行判断。
第一行一个正整数 n。
第二行 n 个正整数 a1,...,an。
n 行每行一个字符串表示结果,如果该数满足要求输出 Yes,否则输出 No。
3
123 24 3
Yes
No
Yes
mycode:
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
for(int i = 1 ; i <= n ; i++){
int x;
cin >> x;
if((x % 1000 >= 100 && x % 1000 <= 999) && x % 10 != 3 && x % 7 != 0) cout << "Yes" <<1<< endl;
else if(!(x % 1000 >= 100 && x % 1000 <= 999) && x % 10 == 3 && x % 7 != 0) cout << "Yes" <<2<< endl;
else if(!(x % 1000 >= 100 && x % 1000 <= 999) && x % 10 != 3 && x % 7 == 0) cout << "Yes" <<3<< endl;
else cout << "No" << endl;
}
return 0;
}