Hints: In This Problem Big Integer Remainder Rule Is Used. Here is Tutorial
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
long long int n,remainder,i;
//freopen("min.txt","r",stdin);
//freopen("mout.txt","w",stdout);
while(cin>>s)
{
remainder=0;
if(s=="0")
{
break;
}
for(i=0;i<s.length();i++)
{
remainder=(remainder*10+(s[i]-'0'))%17;
}
if(remainder==0)
{
cout<<"1"<<endl;
}
else
{
cout<<"0"<<endl;
}
}
return 0;
}
0 comments:
Post a Comment