#include<bits/stdc++.h>
#define sf scanf
#define pf printf
#define LL long long
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
string num="";
while(cin >> num && num!="0"){
int temp = 0;
for (int i = 0; i < num.length(); ++i)
{
temp = temp*10 + num[i]-'0';
temp%=17;
//cout << temp << ' ';
}
temp == 0 ? cout<<1<<'\n':cout<<0<<'\n';
}
return 0;
}
#define sf scanf
#define pf printf
#define LL long long
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
string num="";
while(cin >> num && num!="0"){
int temp = 0;
for (int i = 0; i < num.length(); ++i)
{
temp = temp*10 + num[i]-'0';
temp%=17;
//cout << temp << ' ';
}
temp == 0 ? cout<<1<<'\n':cout<<0<<'\n';
}
return 0;
}
No comments:
Post a Comment