【PAT甲级】1035. Password (20)
来源:互联网 发布:淘宝怎样开通直通车 编辑:程序博客网 时间:2024/05/18 21:51
#include <iostream>#include <string>#include <deque>using namespace std;typedef struct Acc { string name; string ps;} Acc;deque<Acc> out;int main(int argc, char *argv[]) { int n; cin >> n; int i, j; for (i = 0; i < n; i++) { Acc a; cin >> a.name >> a.ps; bool flag = false; for (j = 0; j < a.ps.length(); j++) { if (a.ps.at(j) == '1') { a.ps.replace(j, 1, "@"); flag = true; } else if (a.ps.at(j) == '0') { a.ps.replace(j, 1, "%"); flag = true; } else if (a.ps.at(j) == 'l') { a.ps.replace(j, 1, "L"); flag = true; } else if (a.ps.at(j) == 'O') { a.ps.replace(j, 1, "o"); flag = true; } } if (flag == true) out.push_back(a); } if (out.size() == 0 && n > 1) { cout << "There are " << n << " accounts and no account is modified\n"; return 0; } if (n <= 1) { cout << "There is " << n << " account and no account is modified\n"; return 0; } cout << out.size() << endl; for (i = 0; i < out.size(); i++) { cout << out[i].name << " " << out[i].ps << endl; } return 0;}
0 0
- PAT甲级.1035. Password (20)
- 【PAT甲级】1035. Password (20)
- 1035. Password (20)PAT 甲级
- PAT甲级1035. Password (20)
- PAT 甲级 1035. Password (20)
- PAT甲级 1035. Password (20)
- 1035. Password (20)-PAT甲级真题
- PAT(甲级)1035. Password (20)
- PAT甲级练习1035. Password (20)
- 【PAT】1035. Password (20)
- 1035. Password (20)-PAT
- PAT 1035. Password (20)
- pat 1035. Password (20)
- PAT 1035. Password (20)
- PAT 1035. Password (20)
- PAT 1035. Password (20)
- PAT (Advanced) 1035. Password (20)
- PAT A 1035. Password (20)
- 《西窗法雨》一天读完,怕不怕
- C语言字符串的经典例题
- Linux 安装
- hadoop的安装
- 移动前端不得不了解的HTML5 head 头标签(2016最新版)
- 【PAT甲级】1035. Password (20)
- Java中将数据导出到Excel
- 输出数组中第i大的数(非排序) C++实现
- Private 的重新认识
- HDU_2717_Catch That Cow
- 找出下一个比它大而且值为1的位元数与之相同的数字
- 文章标题
- unix线程同步
- 使用C#创建快捷方式