大数的奇偶性判断
long long 最大为9,223,372,036,854,775,807,处理过大的数是要用字符串
#include <iostream>
#include <string>
using namespace std;
int main(){
string a;
cin>>a;
char last=a.back();
if(last=='0' || last=='2' || last=='4' || last=='6' || last=='8'){
cout<<"even";
}else{
cout<<"odd";
}
}
表示字符串最后一位数用.back()