#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
for (int i=0;i<n;i++){
char num[202];
int denominator;
cin>>num>>denominator;
long long ans=0;
int length=strlen(num);
for (int j=0;j<length;j++){
if (num[j]!='-'){
ans=(ans*10+(num[j]-'0'))%denominator;
}
}
cout<<"Case "<<i+1;
if (ans==0) cout<<": divisible\n";
else cout<<": not divisible\n";
}
return 0;
}
[LightOJ 1214] Large Division
于 2024-01-06 16:07:57 首次发布