C++ 判断整数是否满足条件:能被3整除且不能被5整除
#include
int main() { int n; cin >> n;
if (n % 3 == 0 && n % 5 != 0) {
cout << 'YES' << endl;
} else {
cout << 'NO' << endl;
}
return 0;
}
原文地址: https://www.cveoy.top/t/topic/p7pU 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
#include
int main() { int n; cin >> n;
if (n % 3 == 0 && n % 5 != 0) {
cout << 'YES' << endl;
} else {
cout << 'NO' << endl;
}
return 0;
}
原文地址: https://www.cveoy.top/t/topic/p7pU 著作权归作者所有。请勿转载和采集!