Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<fstream>
- using namespace std;
- ifstream f("bac.txt");
- int ok,s,a,j,k;
- main()
- {
- ok=0;
- s=0;
- while(f>>a)
- {
- if(a%2!=0)
- s=s+1;
- if(s==1)
- {
- f>>j>>k;
- if(a%2==0 && j%2==0 && k%2!=0)
- {
- cout<<a<<" "<<j;
- ok=1;
- }
- else
- {
- a=j;
- j=k;
- f>>k;
- }
- }
- }
- if(ok==0)
- cout<<"nu exista";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement