#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;
}
//длинная арифметика
begin
var a := '123456789123456789';//ReadString();
var b := '123456789123456789123';//...
var l := Abs(a.Length - b.Length);
var source := l*'0';
if a.Length > b.Length then
insert(source, b, 1)
else
insert(source, a, 1);
var s := '';
var mem := 0;
for var i:=a.Length downto 1 do
begin
var c := a[i].ToDigit + b[i].ToDigit + mem;
mem := c div 10;
insert((c mod 10).ToString, s, 1)
end;
if (mem > 0) then insert('1', s, 1);
s.Println;
end.