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 ...
随机推荐
- android,view的执行过程onDraw、onSizeChanged,onFinishInflate
小试view的执行过程,此是入门,高手绕道. ----------------------------------------------------------------------------- ...
- PHP图形处理函数试题
一.问答题 1.取得当前安装的 GD 库的信息的函数是? 2.取得图像大小的函数是? 3.为一幅图像分配颜色 + alpha的函数是? 4.新建一个基于调色板的图像的函数是? 5.新建一个黑色图像的函 ...
- 查看SQL Server 2008的版本及位数
如何查看SQL Server 2008的版本及位数及SP版本: 登录SQL Server,找到“SQL查询分析器”,输入“Select @@version”,运行,即可看出版本及SP版本. 该方法适用 ...
- linux centos下安装g++
1.查看是否安装 g++ -v 2.命令直接安装 yum install gcc-c++ 3.提示你找不到g++安装包,执行下面命令 yum install gcc-c++ libstdc++-dev ...
- hibernate ——联合主键
接上一篇博客:http://www.cnblogs.com/tengpan-cn/p/5551323.html 主键类不需要写任何注解,表对象类使用@IdClass注解 在表对象类前面加@IdClas ...
- Jquery-根据标签的name属性,获取其value值。存入对象并且转换为Json数组
<li id="testinput" name="testinput" value="1" />分类1:标签1</li&g ...
- ClickOnce发布注意的一些细节
细节1.应用程序启动前检查更新: 步骤:主工程-右键属性-发布(页面)-按“更新”按钮-勾选“应用程序应该检查更新(T)”-选择“应用程序启动前(F)”,如下图: 细节二:ClickOnce发布时&q ...
- 转载,find.sh
#!/bin/bash #find files contains a keyword #write by xiaojing.zhao #2012.12.14 echo -e "\nThis ...
- idea编译器中maven项目获取路径的方法
资源文件放在哪里? 上 图中的 resources 目录叫资源目录 (main下,与java如果没有请自行创建), 在项目编译后文件会被放到红色的 classes 目录下, 注意如果你的 resour ...
- Tomcat服务器
常见的web服务器 1. WebLogic是BEA公司的产品,是目前应用最广泛的web服务器,支持J2EE规范(J2EE里有13种技术),商业产品,收费的.银行,证券等对并发,安全要求高的时候用,一般 ...