#include <bits/stdc++.h>
using namespace std;
int main()
{
int years,nums;
cin>>years>>nums;
int n[4];
int count =0,i=0;
for(i=years;;i++)
{ count =1;
n[0]=i/1000;
n[1]=i/100-n[0]*10;
n[2]=i/10-n[0]*100-n[1]*10;
n[3]=i%10;
if(n[0]!=n[1]&&n[0]!=n[2]&&n[0]!=n[3])
count++;
if(n[1]!=n[2]&&n[1]!=n[3])
count++;
if(n[2]!=n[3])
count++;
if(count==nums)
break;
}
printf("%d ",i-years);
printf("%04d",i);
system("pause");
}
L1-033出生年
最新推荐文章于 2024-03-10 14:32:03 发布