#include <iostream>
int main()
{
using namespace std;
const string password = "123456";
string attempted;
cout << "Enter correct password" << endl;
for (int i = 0; i < 3; i++)
cin >> attempted;
if (attempted == password)
cout << "Successful login" << endl;
return 0;
}
else
cout << "Wrong password" << endl;
cout << "Access denied" << endl;
Поделитесь своими знаниями, ответьте на вопрос:
24. Что программа выведет на экран? var i:char; begin to fi for i:= 'a' to ‘f’ do write (i) end.
#include <iostream>
int main()
{
using namespace std;
const string password = "123456";
string attempted;
cout << "Enter correct password" << endl;
for (int i = 0; i < 3; i++)
{
cin >> attempted;
if (attempted == password)
{
cout << "Successful login" << endl;
return 0;
}
else
{
cout << "Wrong password" << endl;
}
}
cout << "Access denied" << endl;
return 0;
}