题意:给你一个B,已知A-A/10=B。让你求A。
我们可以设A最后一位为x那么方程两边同时乘10,化为10*A-A+x=B。
那么9A=B-x,x的范围是0到9,我们枚举x即可。
#include <iostream>
#include <string.h>
#include <algorithm>
#include <stdio.h>
#include <math.h>
using namespace std;
typedef unsigned long long ll;
int main()
{
int t;cin>>t;int cas=0;
while(t--)
{
ll B;
scanf("%llu",&B);
printf("Case %d:",++cas);
for(int x=9;x>=0;x--)
{
ll k=10*B-x;
if(k%9==0)
{
printf(" %llu",k/9);
}
}
printf("\n");
}
return 0;
}