Saleh127

Untitled

Apr 20th, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int b,c,d,e,f,i,j,k,l;
  6. while(1)
  7. {
  8. k=0;
  9. d=0;
  10. char a[1005];
  11. scanf("%s",a);
  12. d=strlen(a);
  13. if(a[0]=='0' && d==1) break;
  14. for(j=0;j<d;j++)
  15. {
  16. k=(a[j]-48)+k*10;
  17. k=k%11;
  18. }
  19. if(k!=0)
  20. {
  21. printf("%s is not a multiple of 11.\n",a);
  22. }
  23. else
  24. {
  25. printf("%s is a multiple of 11.\n",a);
  26. }
  27. }
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment