1035
Description:
按照转换规则将用户密码进行转换,并输出转换情况。
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<algorithm>
#include<map>
#include<vector>
#include<queue>
using namespace std;
char user[15], pass[15];
struct info{
char username[15], password[15];
info(char a[15], char b[15]){strcpy(username,a);strcpy(password, b);}
};
vector<info>ans;
int n;
int main()
{
#ifdef ONLINE_JUDGE
#else
freopen("1.txt", "r", stdin);
#endif // ONLINE_JUDGE
scanf("%d", &n);
for(int i = 0; i < n; i++){
scanf("%s%s", user, pass);
bool mod = false;
for(int j = 0; j < strlen(pass); j++){
if(pass[j] == '1') pass[j] = '@', mod = true;
else if(pass[j] == '0') pass[j] = '%', mod = true;
else if(pass[j] == 'l') pass[j] = 'L', mod = true;
else if(pass[j] == 'O') pass[j] = 'o', mod = true;
}
if(mod){
ans.push_back(info(user,pass));
}
}
if(ans.size() == 0){
if(n == 1)
printf("There is 1 account and no account is modified\n");
else
printf("There are %d accounts and no account is modified\n", n);
}else{
printf("%d\n", ans.size());
for(int i = 0; i < ans.size(); i++)
printf("%s %s\n", ans[i].username, ans[i].password);
}
return 0;
}