mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
1b4d6396e4
2700-2799
24 lines
513 B
C++
24 lines
513 B
C++
#include<iostream>
|
|
using namespace std;
|
|
int main()
|
|
{
|
|
int cases, x = 1;
|
|
cin>>cases;
|
|
while (cases--) {
|
|
int a, b, c, d;
|
|
cin>>a>>b>>c>>d;
|
|
printf("Problem set %d: %d / %d, base 7 digits %d through %d: ", x++, a, b, c, d);
|
|
int i;
|
|
a %= b;
|
|
for (i = 0; i <= d; ++i) {
|
|
a *= 7;
|
|
if (i >= c) {
|
|
printf("%d", a / b);
|
|
}
|
|
a %= b;
|
|
}
|
|
printf("\n");
|
|
}
|
|
return 0;
|
|
}
|