Witam serdecznie,
spotkałem się z pewnym problemem, spowodowanym moją niewiedzą. Otóż jestem nowicjuszem, chcącym (dla siebie po prostu/nauki) zrobić tak, by jeśli po trzech razach się nie wpisze poprawnego loginu bądź następnie hasła, pokazał się napis "Acc has been blocked. Please contact your server Administration. ".
Główkuję nad tym od godziny i nie mogę nic wykombinować, mój ostatni pomysł oznaczony // przed poleceniami (nie działa - build log - "varning: statement has no effect (Wunused-value)".
Dziękuję z góry za okazaną pomoc :)
#include <iostream>
using namespace std;
string log, pass;
int main()
{
cout << "Welcome to the site of nabuchadonozor.pl!" << endl;
cout << "Please write your username (you have three guesses): ";
cin >> log;
for(int i=0; i<2; i++)
{
if(log!="nabucha")
{
cout << "Username is incorrect, please write it again: ";
cin >> log;
}
//for(int==1)
//{
// cout << endl << "Account has been blocked."
//}
}
if(log=="nabucha")
{
cout << "Successfully, next enter your pass: ";
cin >> pass;
}
if(pass=="123")
{
cout << "Valid data, please to make yourself comfortable.";
}
else
{
"Password is incorrect, please write it again: ";
cin >> pass;
}
return 0;
}