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