Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <string>
- #include <algorithm>
- #include <ctype.h>
- using std::cout;
- using std::endl;
- using std::string;
- struct pyt {
- string pytanie;
- string odpowiedz;
- string reakcja;
- };
- int main()
- {
- std::vector<pyt> jeeebac;
- pyt pytanie1;
- pytanie1.odpowiedz = "Tak";
- pytanie1.pytanie = "Czy jebac te studia?";
- pytanie1.reakcja = "No kurwa dobrze";
- pyt pytanie2;
- pytanie2.odpowiedz = "Nie";
- pytanie2.pytanie = "tutaj pytanie";
- pytanie2.reakcja = "elegancko";
- jeeebac.push_back(std::move(pytanie1));
- jeeebac.push_back(std::move(pytanie2));
- int iloscpytan{ 2 };
- for (int i = 0; i < iloscpytan; i++)
- {
- cout << jeeebac[i].pytanie << endl;
- string odp{};
- while (std::cin >> odp)
- {
- std::transform(odp.begin(), odp.end(), odp.begin(), ::tolower);
- std::transform(jeeebac[i].odpowiedz.begin(), jeeebac[i].odpowiedz.end(), jeeebac[i].odpowiedz.begin(), ::tolower);
- if (odp == jeeebac[i].odpowiedz)
- {
- cout << jeeebac[i].reakcja << endl;
- break;
- }
- else
- {
- cout << "Zle !" << endl;
- odp = {};
- continue;
- }
- }
- _sleep(1000);
- system("CLS");
- }
- system("PAUSE");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement