Advertisement
Farjana_akter

Untitled

Jan 29th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. string s;
  7. long long int a,c;
  8. int t,i,j;
  9. cin>>t;
  10. for(i=1;i<=t;i++)
  11. {
  12. cin>>s>>a;
  13. c=0;
  14. for(j=0;j<s.length();j++)
  15. {
  16. if(s[j]!='-'){
  17. c=c*10+(s[j]-'0');
  18. c=c%a;
  19. }
  20. }
  21. if(c==0)
  22. cout<<"Case "<<i<<": "<<"divisible"<<endl;
  23. else
  24. cout<<"Case "<<i<<": "<<"not divisible"<<endl;
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement