Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- int main()
- {
- char a[1000];
- int i,l,rem,sum;
- while(gets(a))
- {
- rem=0;
- l=strlen(a);
- if(l==1&&a[0]=='0')
- break;
- for(i=0;i<l;i++)
- {
- sum=rem*10+(a[i]-'0');
- rem=sum%17;
- }
- if(rem==0)
- printf("1\n");
- else
- printf("0\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement