zoukankan      html  css  js  c++  java
  • zju pat 1035

    //1035
    #include <iostream>
    #include <string.h>
    #include <stdlib.h>
    using namespace std;
    typedef struct DATA
    {
        char name[50];
        char password[50];
        bool modify_flag;
    };
    DATA data[1501];
    
    char change(char c)
    {
        switch(c)
        {
        case '1' : return '@';
        case 'l': return 'L';
        case '0' : return '%';
        case 'O': return 'o';
        default : return -1;
        }
    }
    int main()
    {
        int N,i,j,no_count;
        bool easy_flag;
        while(scanf("%d",&N)!=EOF)
        {
            no_count = 0;
            for(i =0;i<N;i++)
            {
                scanf("%s %s",data[i].name,data[i].password);
                char *temp_s = data[i].password;
                easy_flag = false;
                for(j = 0;temp_s[j]!=0;j++)
                {
                    char temp = change(temp_s[j]);
                    if(temp != -1)
                    {
                        temp_s[j] = temp;
                        easy_flag = true;
                    }
                }
                if(!easy_flag)
                {
                    no_count++;
                    data[i].modify_flag = false;
                }
                else
                    data[i].modify_flag = true;
            }
            if(no_count != N)
                printf("%d
    ",N-no_count);
            for(i =0;i<N;i++)
            {
                if(data[i].modify_flag)
                {
                    printf("%s %s
    ",data[i].name,data[i].password);
                }
            }
            if(no_count == N)
            {
                 if(N <= 1)  
                    printf("There is %d account and no account is modified
    ", N);  
                else  
                    printf("There are %d accounts and no account is modified
    ", N); 
            }
        }
        return 0;
    }
  • 相关阅读:
    awk查看本机IP+查看本网段mac
    wget
    kvm安装,使用,优化
    方向
    bindview+dlz(mysql)
    页面侧滑栏效果
    数据库的事务理解
    页面平衡移动进出的效果
    返回键弹出是否退出对话框
    引导页之页面等待3秒跳转
  • 原文地址:https://www.cnblogs.com/cheng07045406/p/3536124.html
Copyright © 2011-2022 走看看