ZOJ 2514 Generate Passwords 水
啦啦啦,水一发准备去复习功课~
------------------------------------------水一发的分割线------------------------------------------
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1514
水题,没有一次AC我很惭愧,竟然忘了输出总共的个数。。。。。
#include<cstdio>
#include<cstring>
const int MAXN=1000;
struct data
{
bool ok;
char user[12];
char password[12];
}a[MAXN]; int main()
{
int n;
while(~scanf("%d",&n),n)
{
for(int i=0;i<n;i++)
{
scanf("%s%s",a[i].user,a[i].password);
a[i].ok=false;
} int cnt=0;
for(int i=0;i<n;i++)
{
int len=strlen(a[i].password); for(int j=0;j<len;j++)
{
if(a[i].password[j]=='1')
{
a[i].password[j]='@';
a[i].ok=true;
}
else if(a[i].password[j]=='0')
{
a[i].password[j]='%';
a[i].ok=true;
}
else if(a[i].password[j]=='O')
{
a[i].password[j]='o';
a[i].ok=true;
}
else if(a[i].password[j]=='l')
{
a[i].password[j]='L';
a[i].ok=true;
}
} if(a[i].ok)
cnt++;
} if(cnt==0)
printf("No account is modified.\n");
else
{
printf("%d\n",cnt);
for(int i=0;i<n;i++)
{
if(a[i].ok)
{
printf("%s %s\n",a[i].user,a[i].password);
}
}
}
}
return 0;
}
ZOJ 2514 Generate Passwords 水的更多相关文章
- ZOJ 2723 Semi-Prime ||ZOJ 2060 Fibonacci Again 水水水!
两题水题: 1.如果一个数能被分解为两个素数的乘积,则称为Semi-Prime,给你一个数,让你判断是不是Semi-Prime数. 2.定义F(0) = 7, F(1) = 11, F(n) = F( ...
- ZOJ 3827 Information Entropy 水
水 Information Entropy Time Limit: 2 Seconds Memory Limit: 65536 KB Special Judge Informati ...
- ZOJ 3819 Average Score 水
水 Average Score Time Limit: 2 Seconds Memory Limit: 65536 KB Bob is a freshman in Marjar Univer ...
- ZOJ Special AC String 水
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3702 题目大意: 对于给定的一个字符串,满足如下要求输出AC,否则WA(好吧我 ...
- ZOJ 3168 Sort ZOJ7 水
再水一发,舍友肿么还在睡T T. ---------------------------------舍友还在睡觉的分割线--------------------------------- http:/ ...
- ZOJ 3827 Information Entropy 水题
Information Entropy Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.zju.edu.cn/onlinejudge/sh ...
- ZOJ 3846 GCD Reduce//水啊水啊水啊水
GCD Reduce Time Limit: 2 Seconds Memory Limit: 65536 KB Special Judge You are given a sequ ...
- ZOJ 3787 Access System 水
LINK:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3787 思路:结构体 时间转化为秒记录下最小并且排序就好了 /** ...
- ZOJ - 3932 Handshakes 【水】
题目链接 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3932 题意 给出 N 个人,然后 1-N 然后 从 1 - N ...
随机推荐
- [ES6] Extends class in ES6 vs ES5 subclass
ES6 class with extends and super: class Tree { constructor(size = ', leaves = {spring: 'green', summ ...
- thinkphp事务处理以及无效时的解决方案(整理)
thinkphp事务处理以及无效时的解决方案(整理) 一.总结 一句话总结:要程序里面支持事务,首先连接的数据库和数据表必须支持事务 mysql 1.InnoDB和MyISAM对事务的支持怎么样? I ...
- SQL2012的新分页方法
SELECT BusinessEntityID , FirstName , LastName FROM Person.Person ORDER BY BusinessEntityID OFFSET ( ...
- ZOJ QS Network
QS Network Time Limit: 2 Seconds Memory Limit: 65536 KB Sunny Cup 2003 - Preliminary Round Apri ...
- IntelliJ IDEA 启动tomcat 报错: idea Unable to open debugger port (127.0.0.1:58233): java.net.SocketException "socket closed"
debug启动项目弹出提示 Error running omp: Unable to open debugger port (127.0.0.1:50812): java.net.SocketExce ...
- php学习笔记4
PHP数据类型: String(字符串), Integer(整型), Float(浮点型), Boolean(布尔型), Array(数组), Object(对象), NULL(空值). 说明:var ...
- 前端上传文件 后端PHP获取文件
<body> <form action="03-post-file.php" method="post" enctype="mult ...
- COGS——T 2057. [ZLXOI2015]殉国
http://cogs.pro/cogs/problem/problem.php?pid=2057 ★☆ 输入文件:BlackHawk.in 输出文件:BlackHawk.out 评测插件 ...
- lighttpd + php for android 安卓上的WEB服务器
lighttpd + php for android 安卓上的WEBSER 这个项目在 http://hex.ro/wp/blog/php-and-lighttpd-for-android 目前不支持 ...
- 学习笔记:Vue——自定义指令
在Vue2.0中,代码复用和抽象的主要形式是组件.然鹅,有的情况下,你仍然需要对普通DOM元素进行底层操作,这时候就会用到自定义指令. 1.举个聚焦输入框的例子,全局注册focus指令 Vue.dir ...