首页 > 学院 > 开发设计 > 正文

PAT 1035. Password

2019-11-14 09:22:05
字体:
来源:转载
供稿:网友

https://www.patest.cn/contests/pat-a-PRactise/1035 纯模拟 做做水题 陶冶情操 反正我也不会做难题了 = =

#include <bits/stdc++.h>using namespace std;int main(){ int N; scanf("%d/n", &N); vector<pair<string, string> > ans; for (int i = 0; i < N; i++) { string accout, pwd; cin >> accout >> pwd; bool flag = true; for (int i = 0; i < pwd.size(); i++) { if (pwd[i] == '1') pwd[i] = '@', flag = false; else if (pwd[i] == '0') pwd[i] = '%', flag = false; else if (pwd[i] == 'l') pwd[i] = 'L', flag = false; else if (pwd[i] == 'O') pwd[i] = 'o', flag = false; } if (!flag) { ans.push_back(make_pair(accout, pwd)); } } if (ans.size() == 0) { if (N == 1) { cout << "There is 1 account and no account is modified" << endl; } else cout << "There are " << N << " accounts and no account is modified" << endl; } else { cout << ans.size() << endl; for (auto e : ans) { cout << e.first << ' ' << e.second << endl; } }}
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表