PAT 1035. Password (20)

原创 2015年11月21日 13:27:44
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;
#define maxsize 10001
#define  MIN -10001
struct  login{
char acount[11];
char password[11];
int change;
}str[1001];
int main()
{
    int n;
   scanf("%d",&n);
   for(int i=0;i<n;i++)
   scanf("%s%s",str[i].acount,str[i].password);
     for(int i=0;i<n;i++)
     {
         str[i].change=0;
        for(int j=0;j<strlen(str[i].password);j++)
        switch(str[i].password[j])
        {
        case '1':
            str[i].password[j]='@';
            str[i].change=1;
        break;
        case '0':   str[i].password[j]='%';
               str[i].change=1;
        break;
        case 'l':   str[i].password[j]='L';
                 str[i].change=1;
        break;
        case 'O':   str[i].password[j]='o';
                str[i].change=1;
        break;
        }
     }
        int m=0;
        for(int i=0;i<n;i++)
         if(str[i].change==1)
            m++;
        if(n==1&&m==0)
            printf("There is 1 account and no account is modified\n");
        else if(m==0)
            printf("There are %d accounts and no account is modified\n",n);
        else
        {
            printf("%d\n",m);
        for(int i=0;i<n;i++)
        if(str[i].change)
            printf("%s %s\n",str[i].acount,str[i].password);
        }
    return 0;
}

版权声明:未经允许,可以转载

相关文章推荐

PAT-A 1035. Password (20)

PAT-A 1035. Password (20)

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
  • 58

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
  • 111

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

C++

pat 1035. Password (20)

1035. Password (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B ...
  • wyh7280
  • wyh7280
  • 2015年07月17日 20:55
  • 270

PAT (Advanced Level) 1035. Password (20) 解题报告

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

PAT 1035. Password (20)

1035. Password (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B ...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:PAT 1035. Password (20)
举报原因:
原因补充:

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