C++ Password attempt limit
问题 Im trying to write a program that limits the password to three incorrect attempts then exits after 3 incorrect attempts. Here is the code I have thus far. I feel like I am really close to figuring this out but i cannot figure out what to do. #include <fstream> #include <iomanip> #include <iostream> #include <string> #include <cmath> using namespace std; void getPassword() { for(int i = 0; i < 3; i++) { string password; cout << "Enter the password: "; getline(cin, password); if (password ==