1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| #include <iostream> #include <sstream> using namespace std;
int main() { int n; cin >> n; int mod = 0; ostringstream out; for (int i = 0; i < n; i++) { string name, pass; int flag = 0; cin >> name >> pass; for (auto &&ch : pass) { switch (ch) { case 'l': ch = 'L'; flag = 1; break; case '1': ch = '@'; flag = 1; break; case '0': ch = '%'; flag = 1; break; case 'O': ch = 'o'; flag = 1; break; default: break; } } if (flag) { mod++; out << name << " " << pass << endl; } } if (mod) { cout << mod << endl << out.str(); } else { cout << "There " << (n == 1 ? "is" : "are") << " " << n << " account" << (n == 1 ? "" : "s") << " and no account is modified" << endl; } return 0; }
|