PAT(甲级)1035. Password (20)
来源:互联网 发布:百万公众网络测试登录 编辑:程序博客网 时间:2024/06/10 19:00
题目:https://www.patest.cn/contests/pat-a-practise/1035
代码:
#include<cstdio>#include<cstring>#include<cstdlib>#include<algorithm>using namespace std;struct stu{ char id[15]; char pas[15]; int flag;}a[1005];int main(){int n,i,count=0,j;scanf("%d",&n);for(i=0;i<n;i++){scanf("%s %s",&a[i].id,&a[i].pas);int length=strlen(a[i].pas);for(j=0;j<length;j++){if(a[i].pas[j]=='0'||a[i].pas[j]=='O'||a[i].pas[j]=='l'||a[i].pas[j]=='1'){a[i].flag=1;if(a[i].pas[j]=='0'){ a[i].pas[j]='%';}else if(a[i].pas[j]=='O'){ a[i].pas[j]='o';}else if(a[i].pas[j]=='1'){ a[i].pas[j]='@';}else if(a[i].pas[j]=='l'){ a[i].pas[j]='L';}}}}for(i=0;i<n;i++){if(a[i].flag==1){count++;}}if(count==0&&n>1){printf("There are %d accounts and no account is modified",n);}else if(count==0&&n==1){printf("There is %d account and no account is modified",n);}else{ printf("%d\n",count); for(i=0;i<n;i++){ if(a[i].flag==1){ printf("%s %s\n",a[i].id,a[i].pas); } }} system("pause");}
0 0
- 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)
- 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 1035. Password (20)(修改字符串)
- PAT(甲级)Dating (20)
- 用 WEKA 进行数据挖掘,第 3 部分: 最近邻和程序库
- 欢迎使用CSDN-markdown编辑器
- 3种方法求解斐波那契数列
- Codeforces Round #392 (Div. 2) A+B
- 变长vector uva 101
- PAT(甲级)1035. Password (20)
- 涂磊的经典语录
- 肤色检测(Skin-Detection)
- PAT乙级(Basic Level)真题1002
- 单片机按键去抖显示led
- UML之对象图
- 【SSH-商场】——概览
- 6-1
- 5-2 一元多项式的乘法与加法运算 (20分)