Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- usingnamespace std;
- int main ()
- {
- int n,x,y, s=0;
- cin >> n;
- int a[n+1][2] = 0;
- for (int i=0; i<2n-s; i+=2)
- {
- cout <<i<<" "<<i+1;
- cin >> x >> y;
- if (uslov za sucses kod cin)
- {
- if (a[x][0] == 0) a[x][0] = i;
- else a[x][1] = i;
- if (a[y][0] == 0) a[y][0] = i+1;
- else a[y][1] = i+1;
- }
- else s+=2;
- }
- for (int i=1; i<n-s; i++)
- {
- if (a[i][0] != 0)
- {cout << a[i][0] << a[i][1];}
- }
- cout << -1;
- return 0;
- }
- // ima neka fula u syntaci nadji je
- // to je to odprilike ja ga uradio na mobu
- // ubaci gore uslov
- // ubaci flush gdje treba
- // i skontaj sta radi
- //ako bude trebalo debugg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement