肥肠简单の代码
2026-05-28 21:35:42
发布于:广东
1阅读
0回复
0点赞
啊知周所众,奇数(或称单数)即为非2的倍数,所以代码为if(n%2==1),再再再因为余数不能≥除数,所以判偶数代码即为
else
别想太多
即代码为
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
if(n%2==0){
cout<<"even"<<endl;
}
else{
cout<<"odd"<<endl;
}
}
给个赞爸


这里空空如也





有帮助,赞一个