#include <iostream>
#include <fstream>
using namespace std;
ofstream fout("bac.txt");
int main()
{
int s1,s2,a,b,c,d;
cin>>s1>>s2;
if(s1<=9) { a=1; b=s1; } //in functie de s1 stabilim in ce interval merge prima cifra
else { a=s1-9; b=9; }
if(s2<=9) { c=0; d=s2; } //in functie de s2 stabilim in ce interval merge a patra cifra
else { c=s2-9; d=9; }
for(int i=a;i<=b;i++)
for(int j=0;j<=9;j++)
for(int k=c;k<=d;k++)
fout<<i<<s1-i<<j<<k<<s2-k<<"\n";
return 0;
}
|