• 1035 Password (20)


     1 #include <stdio.h>
     2 #include <string.h>
     3 struct MyStruct
     4 {
     5     char ID[11];
     6     char Password[11];
     7     bool changed;
     8 };
     9 int main()
    10 {
    11     int n,i,j;
    12     MyStruct User[1001];
    13     while(scanf("%d",&n)!=EOF)
    14     {
    15         for(i=0;i<n;i++)
    16             User[i].changed=false;
    17         int count = 0;
    18         for(i=0;i<n;i++)
    19         {
    20             getchar();
    21             scanf("%s %s",User[i].ID,User[i].Password);
    22             int fir=1;
    23             for(j=0;j<strlen(User[i].Password);j++)
    24             {
    25             
    26                 if(User[i].Password[j]=='1'||User[i].Password[j]=='0'||User[i].Password[j]=='l'||User[i].Password[j]=='O')
    27                 {
    28                     if(fir) 
    29                     {
    30                         fir=0;
    31                         ++count;
    32                     }
    33                     if(User[i].Password[j]=='1') User[i].Password[j]='@';
    34                     else if(User[i].Password[j]=='0') User[i].Password[j]='%';
    35                     else if(User[i].Password[j]=='l') User[i].Password[j]='L';
    36                     else if(User[i].Password[j]=='O') User[i].Password[j]='o';
    37                     User[i].changed=true;
    38                 }
    39     
    40             }
    41         }
    42 
    43         if(count>0) 
    44         {
    45             printf("%d
    ",count);
    46              for(i=0;i<n;i++)
    47                  if(User[i].changed)
    48                      printf("%s %s
    ",User[i].ID,User[i].Password); 
    49         }
    50         else
    51         {
    52             if(n==1) printf("There is 1 account and no account is modified
    ");
    53             else printf("There are %d accounts and no account is modified
    ",n);
    54         }
    55     }
    56     return 0;
    57 }
  • 相关阅读:
    不弹出提示直接关闭页面
    orcale表解锁
    序列化和反序列化
    js 实现post传参
    简易实现 instanceOf
    简易实现virtualdom
    react中setState同步、异步问题
    CMake Qt 配置 OpenCV
    VS执行时打开cmd
    VS2019+Qt5.15.2环境配置
  • 原文地址:https://www.cnblogs.com/xiaoyesoso/p/4264943.html
Copyright © 2020-2023  润新知