1035. Password (20)
来源:互联网 发布:运动控制仿真软件 编辑:程序博客网 时间:2024/06/01 09:13
#include<cstdio>#include<cstring>struct Info{ char name[11]; char psw[11]; bool isChanged;}node[1001];int main(){ int n,m=0,tem; scanf("%d",&n); tem = n; while (n--) { scanf("%s%s", node[n].name, node[n].psw); for (int i = 0; i < strlen(node[n].psw); i++) { if (node[n].psw[i] == '1' || node[n].psw[i] == '0' || node[n].psw[i] == 'l' || node[n].psw[i] == 'O') { if (node[n].psw[i] == '1') node[n].psw[i] = '@'; else if (node[n].psw[i] == '0') node[n].psw[i] = '%'; else if (node[n].psw[i] == 'l') node[n].psw[i] = 'L'; else if (node[n].psw[i] == 'O') node[n].psw[i] = 'o'; node[n].isChanged = true; } } } for (int i = 0; i < tem;i++) if (node[i].isChanged) m++; if (m == 0) { if (tem>1) printf("There are %d accounts and no account is modified", tem); else printf("There is 1 account and no account is modified"); } else printf("%d\n", m); for (int i = tem; i >= 0; i--) { if (node[i].isChanged) { printf("%s %s", node[i].name, node[i].psw); printf("\n"); } } return 0;}
注意单复数情况的输出格式。
0 0
- 1035. Password (20)
- 【PAT】1035. Password (20)
- 1035. Password (20)-PAT
- 1035. Password (20)
- 1035. Password (20)
- 1035. Password (20)
- PAT 1035. Password (20)
- 1035. Password (20)
- 1035. Password (20)
- 1035. Password (20)
- 1035. Password (20)
- 1035. Password (20)
- 1035. Password (20)
- 1035. Password (20)
- 1035. Password (20)
- 1035. Password (20)
- 1035. Password (20)
- pat 1035. Password (20)
- std::fstream
- java获取硬盘ID以及MAC地址等唯一标识码(详解,测试通过)
- POJ 2728 Desert King (最优比例生成树)
- TCP连接攻击
- 走遍世界 —— 阿拉伯联合酋长国
- 1035. Password (20)
- js 截取 URL中的文件名
- 利用php-cli和任务计划实现刷新token的功能
- 2017年 Android第三方库
- 低功耗蓝牙BLE之广播
- Error: The SDK platform-tools version ((23)) is too old to check APIs compiled with API 23
- 4种Java引用浅解
- W10下,基于myeclipse的hadoop开发环境的配置
- Swing中JFileChooser的用法