题目:http://acm.hdu.edu.cn/showproblem.php?pid=5585
#include <iostream>
#include"cstring"
using namespace std;
int main()
{
char str[31];
int length;
bool flag;
while(cin.getline(str+1,30))
{
flag=false;
length=strlen(str)-1;
if(!((str[length]-'0')&1)) {cout<<"YES"<<endl;flag=true;}
else if((str[length]-'0')==0||(str[length]-'0')==5)
{cout<<"YES"<<endl;flag=true;}
else
{
int sum=0;
for(int i=1;i<=length;i++)
sum+=str[i]-'0';
if(sum%3==0)
{cout<<"YES"<<endl;flag=true;}
}
if(!flag)
cout<<"NO"<<endl;
}
}