通过次数
0
提交次数
判断一个整数能不能被2或者被3整除,若能输出’yes’,反之输出’no’
3
yes
1
no
#include <iostream> #include <cstdio> using namespace std; int main() { int n; cin>>n; if((n%2==0) || (n%3==0)) { cout<<"yes"<<endl; } else { cout<<"no"<<endl; } return 0; }