日本搞逼视频_黄色一级片免费在线观看_色99久久_性明星video另类hd_欧美77_综合在线视频

國內(nèi)最全I(xiàn)T社區(qū)平臺 聯(lián)系我們 | 收藏本站
阿里云優(yōu)惠2
您當(dāng)前位置:首頁 > php開源 > php教程 > 1035. Password (20)

1035. Password (20)

來源:程序員人生   發(fā)布時間:2015-05-21 08:07:53 閱讀次數(shù):2568次

To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distinguish 1 (one) from l (L in lowercase), or 0 (zero) from O (o in uppercase). One solution is to replace 1 (one) by @, 0 (zero) by %, l by L, and O by o. Now it is your job to write a program to check the accounts generated by the judge, and to help the juge modify the confusing passwords.

Input Specification:

Each input file contains one test case. Each case contains a positive integer N (<= 1000), followed by N lines of accounts. Each account consists of a user name and a password, both are strings of no more than 10 characters with no space.

Output Specification:

For each test case, first print the number M of accounts that have been modified, then print in the following M lines the modified accounts info, that is, the user names and the corresponding modified passwords. The accounts must be printed in the same order as they are read in. If no account is modified, print in one line "There are N accounts and no account is modified" where N is the total number of accounts. However, if N is one, you must print "There is 1 account and no account is modified" instead.

Sample Input 1:

3

Team000002 Rlsp0dfa

Team000003 perfectpwd

Team000001 R1spOdfa

Sample Output 1:

2

Team000002 RLsp%dfa

Team000001 R@spodfa

Sample Input 2:

1

team110 abcdefg332

Sample Output 2:

There is 1 account and no account is modified

Sample Input 3:

2

team110 abcdefg222team220 abcdefg333

Sample Output 3:

There are 2 accounts and no account is modified


#include <iostream> #include <string> using namespace std; struct user { string name; string password; bool flag; }; bool password(user &a) { int i; bool flag = false; for(i = 0 ; i < a.password.length(); i++) { switch(a.password[i]) { case '1': flag = true; a.password[i] = '@'; break; case '0': flag = true; a.password[i] = '%'; break; case 'l': flag = true; a.password[i] = 'L'; break; case 'O': flag = true; a.password[i] = 'o'; break; default: continue; } } return flag; } int main() { struct user user[1001]; int n, i; while(cin>>n) { int count = 0; for(i=0; i<n; i++) { cin>>user[i].name>>user[i].password; user[i].flag = false; } for(i=0; i<n; i++) { if(password(user[i])) { user[i].flag = true; count++; } } if(count>0) { cout<<count<<endl; for(i=0; i<n; i++) { if(user[i].flag) { cout<<user[i].name<<" "<<user[i].password<<endl; } } } else { if(n == 1) { cout<<"There is 1 account and no account is modified"<<endl; } else { cout<<"There are "<<n<<" accounts and no account is modified"<<endl; } } } return 0; }


生活不易,碼農(nóng)辛苦
如果您覺得本網(wǎng)站對您的學(xué)習(xí)有所幫助,可以手機(jī)掃描二維碼進(jìn)行捐贈
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
關(guān)閉
程序員人生
主站蜘蛛池模板: 在线黄网| 日韩视频在线一区二区 | 黄a在线观看 | 日韩午夜精品视频 | 91免费视频网 | 欧洲精品码一区二区三区免费看 | 男人av在线 | 色大师高清在线播放免费 | 在线看的av| 成人国产精品一区二区免费麻豆 | 久久久久国产一区二区三区四区 | 91欧美一区二区三区成人 | 精品二区 | 国产精品电影一区二区 | 亚洲国产精品一区二区尤物区 | 91电影在线观看 | 在线观看国产视频 | 国产精品不卡一区二区三区 | 激情在线视频 | 成人欧美一区二区 | 欧美精品一区二区三区蜜桃视频 | 看a网站 | 热久久久 | 91精品久久久久久久99蜜桃 | 成人欧美一区二区三区视频网页 | 国产精品美女久久久久aⅴ国产馆 | 免费一区二区视频 | 黑人爆操| 国产欧美日韩在线观看 | 99精品国产高清在线观看 | 国产精品成人一区二区三区 | 免费观看黄 | www.夜夜骑.com | 国产一区欧美一区 | 欧美一区免费 | 日本一二三区视频 | 久久午夜精品视频 | 欧美在线一区二区 | 在线天堂网| 黄色伊人网 | 可以在线观看的av |