zoukankan      html  css  js  c++  java
  • PAT:1035. Password (20) AC

    #include<stdio.h>
    #include<string.h>
    
    typedef struct STU
    {
      char mID[15];
      char mpass[15];
      bool tag;
    }STU;
    
    STU arr[1010];
    int main()
    {
      memset(arr,0,sizeof(arr));
      int n,change=0;
      scanf("%d",&n);
      for(int i=0 ; i<n ; ++i)
      {
        scanf("%s %s",&arr[i].mID,&arr[i].mpass);
        int len=strlen(arr[i].mpass);
        int tag=0;                //判断这个输入是否改过
        for(int j=0 ; j<len ; ++j)
        {
          if(arr[i].mpass[j]=='1'){
            ++tag;
            arr[i].tag=1;
            arr[i].mpass[j]='@';
          }
          else if(arr[i].mpass[j]=='0'){
            ++tag;
            arr[i].tag=1;
            arr[i].mpass[j]='%';
          }
          else if(arr[i].mpass[j]=='O'){
            ++tag;
            arr[i].tag=1;
            arr[i].mpass[j]='o';
          }
          else if(arr[i].mpass[j]=='l'){
            ++tag;
            arr[i].tag=1;
            arr[i].mpass[j]='L';
          }
        }
        if(tag!=0)
          ++change;              //记录改变数的个数
      }
      if(n==1 && change==0)
        printf("There is 1 account and no account is modified");
      else if(n>1 && change==0)
        printf("There are %d accounts and no account is modified",n);
      else
      {
        printf("%d
    ",change);
        for(int i=0 ; i<n ; ++i)
        {
          if(arr[i].tag==1)
            printf("%s %s
    ",arr[i].mID,arr[i].mpass);
        }
      }
      return 0;
    }
  • 相关阅读:
    cl编译器命令行调试问题
    西电计算机专业培养
    GCN代码实现
    GCN介绍
    cpu密集型任务及IO密集型任务,GIS,多进程及多线程
    骨架提取
    视频文件的一些属性
    空洞填充
    凸包,二值图家矩形框
    RGB图片取大于阈值部分
  • 原文地址:https://www.cnblogs.com/Evence/p/4297052.html
Copyright © 2011-2022 走看看