蛇皮

奥义蛇皮走位之反复横跳(二)

断了今生、忘了曾经 提交于 2020-02-26 12:38:07
循环嵌套之暴力破解密码 //首先写一个登录程序 # include <iostream> # include <Windows.h> # include <string> using namespace std ; int main ( void ) { string pwd ; while ( 1 ) { cout << "Please input your password: " ; cin >> pwd ; if ( pwd == "000123" ) { break ; } else { cout << "Password error." << endl ; } } cout << "login success" << endl ; cout << "1. 注册" << endl ; cout << "2. 管理" << endl ; cout << "3. 查询" << endl ; cout << "4. 删除" << endl ; system ( "pause" ) ; return 0 ; } //破解程序 # include <iostream> using namespace std ; int main ( void ) { char pwd [ 7 ] ; char dict [ 64 ] ; //10+26+26+1 = 63; char tmp [