AcWing 1519. 密码
原题链接
简单
作者:
Wegoon
,
2021-09-05 23:04:24
,
所有人可见
,
阅读 356
知识点:模拟、字符串处理
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 1e3 + 5;
int n, id;
string a[N], b[N], name, s;
int main() {
cin >> n;
for (int i = 0; i < n; i ++ ) {
cin >> name >> s;
bool flag = false;
for (int i = 0; s[i]; i ++ ) {
if(s[i] == '1') s[i] = '@', flag =true;
if(s[i] == '0') s[i] = '%', flag =true;
if(s[i] == 'l') s[i] = 'L', flag =true;
if(s[i] == 'O') s[i] = 'o', flag =true;
}
if(flag) a[id] = name, b[id ++ ] = s;
}
if(!id) {
if (n == 1) printf("There is %d account and no account is modified", n);
else printf("There are %d accounts and no account is modified", n);
}
else {
cout << id;
for (int i = 0; i < id; i ++ ) cout << endl << a[i] << ' ' << b[i];
}
return 0;
}