The last digit.
Here is my code:
#include<iostream>
#include<string>
using namespace std;
int main()
{
long n;
cin>>n;
for(long i=1;i<=n;i++)
{
string s;
cin>>s;
if(s.at(s.length()-1)%2==0)
cout<<"even"<<endl;
else cout<<"odd"<<endl;
}
return 0;
}
posted on 2010-10-21 22:31
lee1r 阅读(295)
评论(0) 编辑 收藏 引用 所属分类:
题目分类:基础/模拟