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