Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- int main()
- {
- int test;
- cin>>test;
- for(int t=1;t<=test;t++)
- {
- ll temp=0,b,j=0;
- string a;
- cin>>a;
- if(a[0]=='-')j=1;
- cin>>b;
- for(j;j<a.size();j++)
- {
- temp=temp*10+(a[j]-'0');
- temp=temp%b;
- //cout<<temp<<endl;
- }
- if(temp==0)printf("Case %d: divisible\n",t);
- else printf("Case %d: not divisible\n",t);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement