Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<vector>
- #include<fstream>
- #include<algorithm>
- #include<string>
- #include<list>
- #include<tuple>
- using namespace std;
- struct pomiar{
- pair<int, int>jedenDwa;
- };
- int main()
- {
- pomiar p;
- vector<pomiar>dane;
- int ile_par;
- cout << "Ile par" << endl;
- cin >> ile_par;
- cout << "Wpisz pary cyfr" << endl;
- for (int i = 0; i < ile_par; i++)
- {
- int x, y;
- if (i > 0)
- {
- cout << "pierwsza: " << endl;
- cin >> x;
- }
- else
- x = 0;
- cout << "druga " << endl; cin >> y;
- p.jedenDwa = make_pair(x, y);
- dane.push_back(p);
- }
- bool dojdzie=false;
- int z = 0;
- for (int d = 0;d < dane.size();d++)
- {
- for (int i = 1; i < dane.size(); i++)
- {
- if (dane[z].jedenDwa.second == dane[i].jedenDwa.first)
- {
- if (dane[i].jedenDwa.second == 5)
- {
- dojdzie = true;
- break;
- }
- else
- z = i;
- }
- else continue;
- }
- }
- if (dojdzie == true)
- cout << "JANEK DOJDZIE DO SKLEPU!!" << endl;
- else
- cout << "Nie dojdzie :(" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement