关闭

PAT 1035 Password

标签: PAT
173人阅读 评论(0) 收藏 举报
分类:
#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main()
{
vector<pair<string,string > > vec;
pair<string,string> tmp;
int num;
cin >> num;
int flag = 0;
int count = 0;
for (int i = 0; i < num; ++i)
{
cin >> tmp.first >> tmp.second;

for (int j = 0; j < tmp.second.size(); ++j)
{
switch (tmp.second[j])
{


case '1':
tmp.second[j] = '@';
flag = 1;
break;
case '0':
tmp.second[j] = '%';
flag = 1;
break;
case 'l':
tmp.second[j] = 'L';
flag = 1;
break;
case'O':
tmp.second[j] = 'o';
flag = 1;
}
}
if (flag)
{
count++;
flag = 0;
vec.push_back(tmp);
}
}
if (count)
{
cout << count << endl;
for (int k = 0; k < count; ++k)
{
cout << vec[k].first <<" "<<vec[k].second<<endl;
}
}
else if(num == 1)
{
cout << "There is 1 account and no account is modified" << endl;
}
else
{
cout << "There are "<<num<<" accounts and no account is modified"<<endl;
}


return 0;
}
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:8944次
    • 积分:343
    • 等级:
    • 排名:千里之外
    • 原创:26篇
    • 转载:0篇
    • 译文:0篇
    • 评论:2条