while (true) {
//*first loop*// while (true) {
cout << "U svojoj sobi si, odaberi sta zelis uraditi \n(izaci, ostati)\n";
getline(cin, odgovor);
if (odgovor == "izaci")
break;
if (odgovor == "ostati")
continue;
else
cout << "Odgovor nije validan! \n";
}
cout << "(javiti se, vratiti se u sobu, prekinuti poziv\n";
//*second loop *// while (true) {
getline(cin, odgovor);
if (odgovor=="vratiti se u sobu")
//* return to first loop*//
}
#include <iostream>
#include <string>
int main ()
{
std::string reply{};
while (true)
{
// * first loop * //
while (true)
{
std::cout << "You are in your room, choose what you want to do \n (get out, stay) \n";
std::getline (std::cin, reply);
if (reply == "get out")
break;
if (reply == "stay")
continue;
else
std::cout << "The answer is not valid! \n";
}
std::cout << "(please login, return to the room, cancel the call \n";
// * second loop * //
while (true)
{
std::getline (std::cin, reply);
if (reply == "go back")
break;
}
}
}