Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <fstream>
- using namespace std;
- int main()
- {
- int x,y,a,okx=0,oky=0;
- ifstream fin("bac.txt");
- fin>>x>>y;
- if(x>y)
- {
- a=y;
- y=x;
- x=a;
- }
- while(fin>>a)
- {
- if((x<a)&&(okx==0))
- {
- cout<<x;
- okx=1;
- }
- if((y<a)&&(oky==0))
- {
- cout<<y;
- oky=1;
- }
- cout<<a;
- }
- if(okx==0)
- cout<<x;
- if(oky==0)
- cout<<y;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement