명품 C++ programming 11장 실습문제 10번


명품 C++ programming 11장 실습문제 10번

문제 다음은 프로그램과 실행 결과를 보여준다. prompt 조작자를 작성하여 프로그램을 완성하라. 12345678910111213141516#include <iostream>#include <string>using namespace std; int main() { string password; while(true) { cin >> prompt >> password; if(password == "C++") { cout << "login success!!" << endl; break; } else cout << "login fail. try again!!" << endl; }} 실행 결과 : 내가 짠 코드 #include <iostream>#include <string>using namespace std;istream& prompt(istream& in) { cout << "암호?"; return in;}int main() { string passw..........



원문링크 : 명품 C++ programming 11장 실습문제 10번