PAT (Advanced Level) 1084. Broken Keyboard (20)
简单题。
#include<cstdio>
#include<cstring>
#include<cmath>
#include<vector>
#include<map>
#include<queue>
#include<stack>
#include<algorithm>
using namespace std; const int maxn=;
char s[maxn],t[maxn],u[maxn];
int flag[]; int main()
{
scanf("%s",s);
scanf("%s",t); for(int i=;s[i];i++)
if(s[i]>='a'&&s[i]<='z') s[i]=s[i]-'a'+'A';
for(int i=;t[i];i++)
if(t[i]>='a'&&t[i]<='z') t[i]=t[i]-'a'+'A'; memset(flag,,sizeof flag); int p1=,p2=; while()
{
if(s[p1]==t[p2])
{
p1++;
p2++;
}
else
{
if(flag[s[p1]]==)
{
printf("%c",s[p1]);
flag[s[p1]]=;
}
p1++;
}
if(s[p1]==) break;
}
return ;
}
PAT (Advanced Level) 1084. Broken Keyboard (20)的更多相关文章
- PAT (Advanced Level) 1112. Stucked Keyboard (20)
找出一定没问题的字符(即一连串的额字符x个数能被k整除的),剩下的字符都是可能有问题的. #include<cstdio> #include<cstring> #include ...
- 【PAT甲级】1084 Broken Keyboard (20 分)
题意: 输入两行字符串,输出第一行有而第二行没有的字符(对大小写不敏感且全部以大写输出). AAAAAccepted code: #define HAVE_STRUCT_TIMESPEC #inclu ...
- 1084. Broken Keyboard (20)【字符串操作】——PAT (Advanced Level) Practise
题目信息 1084. Broken Keyboard (20) 时间限制200 ms 内存限制65536 kB 代码长度限制16000 B On a broken keyboard, some of ...
- PAT (Advanced Level) Practice 1035 Password (20 分) 凌宸1642
PAT (Advanced Level) Practice 1035 Password (20 分) 凌宸1642 题目描述: To prepare for PAT, the judge someti ...
- PAT (Advanced Level) Practice 1008 Elevator (20 分) 凌宸1642
PAT (Advanced Level) Practice 1008 Elevator (20 分) 凌宸1642 题目描述: The highest building in our city has ...
- PAT Advanced 1084 Broken Keyboard (20) [Hash散列]
题目 On a broken keyboard, some of the keys are worn out. So when you type some sentences, the charact ...
- 1084. Broken Keyboard (20)
On a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters ...
- PAT (Advanced Level) Practice 1035 Password (20 分)
To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem ...
- 【PAT Advanced Level】1008. Elevator (20)
没什么难的,简单模拟题 #include <iostream> using namespace std; int main() { int num; cin>>num; int ...
随机推荐
- svg笔记----------path篇
每个路径都必须以moveto 命令开始 moveto.lineto和closepath <path d="M 10 10 L 100 10z"/> 大写字母命令的坐标是 ...
- jquery新窗口打开链接
第一种:下面的代码是针对m35ui这个样式下的a都是在新窗口打开 <script type="text/javascript"> jQuery(document ...
- 在Linux系统如何让程序开机时自动启动
在Linux系统如何让程序开机时自动启动 核心提示:系统的服务在开机时一般都可以自动启动,那在linux系统下如果想要程序在开机时自动启动怎么办?我们知道在 windows系统“开始”--& ...
- linux配置使用外部smtp发送邮件
mail命令需要设定mail.rc(或nail.rc)文件, set from=user@domain.comset smtp=smtp.domain.comset smtp-auth-user=us ...
- THE ROAD TO PROGRAM
<The C Programming Language> <The Practice of Programming><The Art of Computer Progra ...
- SQL中的左连接与右连接有什么区别,点解返回值会不同?(转)
例子,相信你一看就明白,不需要多说 A表(a1,b1,c1) B表(a2,b2) a1 b1 c1 a2 b2 01 数学 95 01 张三 02 语文 90 02 李四 03 英语 80 04 王五 ...
- vim 设置默认显示行号
vim 要默认打开的时候显示行号,这样就可以不用每次编辑的时候在手动在命令模式下:set number 来显示行号. 具体做法是: 创建一个 .vimrc的配置文件. 在启动vim时,当前用户根目录下 ...
- C/C++ - 结构体实际申请的空间
C/C++ - 结构体实际申请的空间 如下的结构体,sizeof()大小,实际申请的空间以及理论上申请最佳空间 struct Spot { int x; int y; bool visible; in ...
- Android实现GIF图片解码与播放
Android实现GIF图片解码与播放 如何在Android中播放GIF图片呢?如果直接按以前的方法,分解图片,可能相对比较麻烦. 今天给大伙介绍一种新的方式,构造自己的Android图片解码帮助类, ...
- db2数据导出导入
C:\Users\yexuxia>set db2instance=TCASHMAN C:\Users\yexuxia>db2(c) Copyright IBM Corporation 19 ...