12345678910111213141516171819202122
#include<iostream> #include<string> using namespace std; int main() { string password = "password"; string pwd; cin >> pwd; if( pwd == password ) cout << "Correct" << endl; cin.get(); cin.ignore(); return 0; }
12345
while( pwd != password ) { cout << "try again" << endl; cin >> pwd; }