Skip to content

Instantly share code, notes, and snippets.

@fardinabir
Created October 2, 2019 20:14
Show Gist options
  • Save fardinabir/58bdc4050c6509c6359bc6f4cc9c2bcc to your computer and use it in GitHub Desktop.
Save fardinabir/58bdc4050c6509c6359bc6f4cc9c2bcc to your computer and use it in GitHub Desktop.
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main ()
{
ll tc,idd=0,p,n,a,b,c,c1,c2,c3,t,id,d,l,r,num=1,k,x,i;
string st;
seive();
scanf("%lld",&tc);
while(idd<tc){
cin>>st;
scanf("%lld",&a);
printf("Case %lld: ",++idd);
n=0,i=0;
if(st[0]=='-')
i++;
while(i<st.size())
{
n=n*10+(st[i++]-48);
n=n%a;
}
if(n==0)
printf("divisible\n");
else
printf("not divisible\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment