- 浏览: 36432 次
- 性别:
- 来自: 杭州
最新评论
Sample Input 1:
3 Team000002 Rlsp0dfa Team000003 perfectpwd Team000001 R1spOdfaSample Output 1:
2 Team000002 RLsp%dfa Team000001 R@spodfaSample Input 2:
1 team110 abcdefg332Sample Output 2:
There is 1 account and no account is modifiedSample Input 3:
2 team110 abcdefg222 team220 abcdefg333Sample Output 3:
There are 2 accounts and no account is modified
#include <iostream> #include <string> #include <iomanip> #include <vector> using namespace std; struct USERINFO { string username; string password; int flag; USERINFO() { flag = 0; } }; int IsModify(string &password) { int flag = 0; for (int i = 0; i < password.length(); i++) { switch (password[i]) { case '1': password[i] = '@'; flag = 1; break; case '0': password[i] = '%'; flag = 1; break; case 'l': password[i] = 'L'; flag = 1; break; case 'O': password[i] = 'o'; flag = 1; break; default: break; } } return flag; } int main() { int N; cin>>N; int count = 0; vector<USERINFO> V; for (int i = 0; i < N; i++) { USERINFO info; cin>>info.username>>info.password; info.flag = IsModify(info.password); if (info.flag == 1) { count++; } V.push_back(info); } if (count == 0) { if (N > 1) { cout<<"There are "<<N<<" accounts and no account is modified"; } else { cout<<"There is 1 account and no account is modified"; } return 0; } cout<<count<<endl; for (int i = 0; i < N; i++) { if (V[i].flag == 1) { cout<<V[i].username<<" "<<V[i].password<<endl; } } return 0; }
发表评论
-
PAT1013 Battle Over Cities
2012-11-29 23:59 768Sample Input 3 2 3 1 2 1 3 ... -
PAT1003 Emergency
2012-11-29 23:46 656Sample Input 5 6 0 2 1 2 1 ... -
PAT1041 Be Unique
2012-11-23 23:43 752找出只出现过一次的数,用各种排序必然超时,需要用数组做hash ... -
PAT1042 Shuffling Machine
2012-11-23 23:42 727扑克洗牌 #include < ... -
PAT1040 Longest Symmetric String
2012-11-23 23:41 953求最长回文子串 #include < ... -
PAT1036 Boys vs Girls
2012-11-23 23:41 710Sample Input 1: 3 Joe M Mat ... -
PAT1031 Hello World for U
2012-11-22 23:54 649Sample Input: helloworld! S ... -
PAT1029 Median
2012-11-22 23:54 648用标准库的排序全部超时,需要自己实现,另外还不能用cin co ... -
PAT1028 List Sorting
2012-11-22 23:53 802用vector最后一个用例超时了。。。 Sample ... -
PAT1027 Colors in Mars
2012-11-22 23:52 616Sample Input 15 43 71 Samp ... -
PAT1025 PAT Ranking
2012-11-22 23:51 765Sample Input: 2 5 123456789 ... -
PAT1023 Have Fun with Numbers
2012-11-21 23:55 682大数的相加 比较两个字符串中字符完全相同 Sa ... -
PAT1020 Tree Traversals
2012-11-21 23:54 648已知中序遍历 后序遍历,求层次遍历 Sample In ... -
PAT1019 General Palindromic Number
2012-11-21 23:53 534十进制转任意进制,并比较是否是回文数 Sample I ... -
PAT1037 Magic Coupon
2012-11-21 15:46 656Sample Input: 4 1 2 4 -1 ... -
PAT1038 Recover the Smallest Number
2012-11-20 23:52 1663由一道面试题改的 把数组排成最小的数 不同之处是这 ... -
PAT1024 Palindromic Number
2012-11-20 23:51 643Sample Input 1: 67 3 Sampl ... -
PAT1015 Reversible Primes
2012-11-19 23:51 766十进制转任意进制 假设十进制数为number,转 ... -
PAT1012 The Best Rank
2012-11-19 23:50 922四门功课,输出排名最高的是哪个 Sample Inpu ... -
PAT1011 World Cup Betting
2012-11-19 23:50 531Sample Input 1.1 2.5 1.7 1.2 ...
相关推荐
1035 Password (20 分)【对应的替换,注意输出,巧用vector和string】 1005 Spell It Right (20 分)【int与string互换,hash打表】 1082 Read Number in Chinese (25 分)【将数字转成中文】 1093 Count ...
instead of the enable password when it exists. Enter enable secret: cisco 3.设置进入特权状态的密码(password),此密码只在没有密文时起作用,并且在设置以后会以明文方式显示: The enable password is ...
:hamburger: efoodgr 一个非官方的工具,用于管理您的帐户和下订单。给我买咖啡 :hot_beverage:... login ( 'your.email@efood.gr' , 'your-password-or-pat' ) ; let addresses = await session . getUserAddresses
是iOS 6的一项功能,可管理登机牌,电影票,零售优惠券和会员卡。 使用 ,开发人员可以注册Web服务,以自动更新通行证上的内容,例如登机牌上的登机口更改或在会员卡中添加积分。... password = "/pat
Java版QQ签到源码欧盟数字 COVID 证书网关 • • • • • • 关于 该存储库包含欧盟数字 ...用于在所有国家后端服务器...替换${app.packages.password} GitHub Docker 注册表 在运行进一步的docker login docker.pkg.gith
dotnet nuget add source "json azure devops package url" -n name_repo_artifact -u anything -p <pat> --store-password-in-clear-text 范围:打包(读取),打包(读取和写入)或打包(读取,写入和管理)。
dotnet nuget add source "json azure devops package url" -n name_repo_artifact -u anything -p <pat> --store-password-in-clear-text 范围:打包(读取),打包(读取和写入)或打包(读取,写入和管理)。
dotnet nuget add source "json azure devops package url" -n name_repo_artifact -u anything -p <pat> --store-password-in-clear-text 范围:打包(读取),打包(读取和写入)或打包(读取,写入和管理)。
dotnet nuget add source "json azure devops package url" -n name_repo_artifact -u anything -p <pat> --store-password-in-clear-text 范围:打包(读取),打包(读取和写入)或打包(读取,写入和管理)。
dotnet nuget add source "json azure devops package url" -n name_repo_artifact -u anything -p <pat> --store-password-in-clear-text 范围:打包(读取),打包(读取和写入)或打包(读取,写入和管理)。
dotnet nuget add source "json azure devops package url" -n name_repo_artifact -u anything -p <pat> --store-password-in-clear-text 范围:打包(读取),打包(读取和写入)或打包(读取,写入和管理)。
本文实例讲述了python实现的config文件读写功能。分享给大家供大家参考,具体如下: 1、设置配置文件 [mysql] host = 1234 port = 3306 user = root ... root_path = os.path.dirname(os.path.dirname(os.pat