Pages

Friday, August 12, 2011

d124. 3的倍数


#include
#include
using namespace std;

int main()
{
string str="0";
int input;

while(getline(cin,str))
{
int sum=0;
for(int i=0;i {
sum += str[i];
sum = sum%3;
}
if(sum==0)
cout<<"yes"< else
cout<<"no"<
}

return 0;
}

No comments:

Post a Comment