PAT 1035 Password

原创 2015年07月09日 16:53:27
#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;
}

相关文章推荐

PAT-A 1035. Password (20)

PAT-A 1035. Password (20)

PAT:A1035. Password (20/20)

To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem ...

PAT A1035 Password 三个经验仔细看!

//经验1:如果遇到20分的题,有5分两个点没有通过,不要担心,细心一点复查,仔细对输入输出;仔细考虑特殊情况,你可以的,不要慌 //经验2:if else语句还是写完整,每种情况不要偷懒 //经验...

1035. Password (20)【字符串处理】——PAT (Advanced Level) Practise

题目信息1035. Password (20)时间限制400 ms 内存限制65536 kB 代码长度限制16000 BTo prepare for PAT, the judge sometime...

PAT A1035. Password (20)

To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem ...
  • jolivan
  • jolivan
  • 2017年02月07日 17:47
  • 62

Pat(Advanced Level)Practice--1035(Password)

Pat1035代码 题目描述: To prepare for PAT, the judge sometimes has to generate random passwords for...

PAT A 1035. Password (20)

题目 To prepare for PAT, the judge sometimes has to generate random passwords for the users.  The pro...

PAT(甲级)1035. Password (20)

题目:https://www.patest.cn/contests/pat-a-practise/1035 代码:#include #include #include #include using ...

1035. Password (20)-PAT甲级真题

1035. Password (20) To prepare for PAT, the judge sometimes has to generate random passwords fo...
  • liuchuo
  • liuchuo
  • 2016年08月04日 18:28
  • 112

浙江大学PAT_甲级_1035. Password (20)

C++
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:PAT 1035 Password
举报原因:
原因补充:

(最多只允许输入30个字)