Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <algorithm>
- using namespace std;
- ifstream f("egale.in");
- ofstream g("egale.out");
- long long c,p,x,i,a,o,cnt1,cnt2,ucf,b,s,o1,cnt,j;
- int main()
- {
- f>>c;
- if(c==2)
- {
- f>>a;
- p=1;x=1;
- while(p<=a)
- {
- for(i=1;i<=9;i++)
- {
- for(j=1;j<=p;j++)
- g<<i;
- g<<" ";
- }
- p++;
- }
- }
- else
- {
- f>>a>>b;
- s=a+b;
- a=min(a,b);
- b=s-a;
- o=a;o1=b;
- cnt=0;cnt2=0;
- while(o!=0)
- {
- cnt++;
- o/=10;
- }
- while(o1!=0)
- {
- cnt2++;
- o1/=10;
- }
- for(i=1;i<=cnt;i++)
- x=x*10+1;
- for(j=cnt;j<=cnt2;j++)
- {
- for(i=1;i<=9;i++)
- {
- if(x*i<=b&&x*i>=a)
- g<<x*i<<" ";
- }
- x=x*10+1;
- }
- }
- f.close();
- g.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement