PAT (Basic Level) Practise (中文)-1029. 旧键盘(20)
PAT (Basic Level) Practise (中文)-1029. 旧键盘(20)
http://www.patest.cn/contests/pat-b-practise/1029
旧键盘上坏了几个键,于是在敲一段文字的时候,对应的字符就不会出现。现在给出应该输入的一段文字、以及实际被输入的文字,请你列出肯定坏掉的那些键。
输入格式:
输入在2行中分别给出应该输入的文字、以及实际被输入的文字。每段文字是不超过80个字符的串,由字母A-Z(包括大、小写)、数字0-9、以及下划线“_”(代表空格)组成。题目保证2个字符串均非空。
输出格式:
按照发现顺序,在一行中输出坏掉的键。其中英文字母只输出大写,每个坏键只输出一次。题目保证至少有1个坏键。
输入样例:
7_This_is_a_test
_hs_s_a_es
输出样例:
7TI
#include<stdio.h> void upper(char *str1)
{
int istr=;
while(str1[istr])
{
if('a'<=str1[istr] && str1[istr]<='z')
str1[istr]=str1[istr]-'a'+'A';
istr++;
}
} int main()
{
char tempchar=,str[],strprint[],keys[]={};
gets(str);upper(str);
gets(strprint);upper(strprint); int istr=,istrprint=;
while(str[istr])
{
if(str[istr]==strprint[istrprint]) istrprint++;
else if(==keys[str[istr]]) keys[str[istr]]=,printf("%c",str[istr]);
istr++;
} return ;
}
PAT (Basic Level) Practise (中文)-1029. 旧键盘(20)的更多相关文章
- PAT (Basic Level) Practise:1029. 旧键盘
[题目链接] 旧键盘上坏了几个键,于是在敲一段文字的时候,对应的字符就不会出现.现在给出应该输入的一段文字.以及实际被输入的文字,请你列出肯定坏掉的那些键. 输入格式: 输入在2行中分别给出应该输入的 ...
- PAT (Basic Level) Practise:1033. 旧键盘打字
[题目链接] 旧键盘上坏了几个键,于是在敲一段文字的时候,对应的字符就不会出现.现在给出应该输入的一段文字.以及坏掉的那些键,打出的结果文字会是怎样? 输入格式: 输入在2行中分别给出坏掉的那些键.以 ...
- PAT (Basic Level) Practise (中文)-1033. 旧键盘打字(20)
PAT (Basic Level) Practise (中文)-1033. 旧键盘打字(20) http://www.patest.cn/contests/pat-b-practise/1033 旧 ...
- PAT (Basic Level) Practise (中文)-1039. 到底买不买(20)
PAT (Basic Level) Practise (中文)-1039. 到底买不买(20) http://www.patest.cn/contests/pat-b-practise/1039 小红 ...
- PAT (Basic Level) Practise (中文)- 1022. D进制的A+B (20)
PAT (Basic Level) Practise (中文)- 1022. D进制的A+B (20) http://www.patest.cn/contests/pat-b-practise/1 ...
- PAT (Basic Level) Practise (中文)- 1024. 科学计数法 (20)
PAT (Basic Level) Practise (中文)- 1024. 科学计数法 (20) http://www.patest.cn/contests/pat-b-practise/1024 ...
- PAT (Basic Level) Practise (中文)-1025. 反转链表 (25)
PAT (Basic Level) Practise (中文)-1025. 反转链表 (25) http://www.patest.cn/contests/pat-b-practise/1025 ...
- PAT (Basic Level) Practise (中文)- 1026. 程序运行时间(15)
PAT (Basic Level) Practise (中文)- 1026. 程序运行时间(15) http://www.patest.cn/contests/pat-b-practise/10 ...
- PAT (Basic Level) Practise (中文)-1027. 打印沙漏(20)
PAT (Basic Level) Practise (中文)-1027. 打印沙漏(20) http://www.patest.cn/contests/pat-b-practise/1027 本题 ...
随机推荐
- layui icon样式1到7
1: 2: 3: 4: 5: 6: 7:
- SQL 语句(原生)
//查 //查询表里的所有数据 select * from 表名 //根据id等字段查询数据 select * from 表名 where 字段 = 值 or 字段 = 值 (例):select * ...
- hoj2798 Globulous Gumdrops
Globulous Gumdrops My Tags (Edit) Source : 2008 Stanford Programming Contest Time limit : 1 se ...
- P3803 【模板】多项式乘法(NTT)
传送门 NTT好像是比FFT快了不少 然而感觉不是很看得懂……主要是点值转化为系数表示那里…… upd:大概已经搞明白是个什么玩意儿了……吧…… //minamoto #include<bits ...
- MyBatis嵌套Collection
站在巨人的肩膀上 https://blog.csdn.net/liaoxiaohua1981/article/details/6862466 聚集元素用来处理“一对多”的关系.需要指定映射的Java实 ...
- 黑马函数式接口学习 Stream流 函数式接口 Lambda表达式 方法引用
- 线程安全 原子性 可见性 顺序性 volatile
- 51Nod 1242 斐波那契数列的第N项(矩阵快速幂)
#include <iostream> #include <algorithm> using namespace std; typedef long long LL; ; ; ...
- SpringBoot | SpringBoot启动错误
Error starting ApplicationContext. To display the conditions report re-run your application with 'de ...
- Codeforces 1142C(转化、凸包)
可以变换坐标:x' = x, y' = y - x ^ 2,如此之后可得线性函数x' * b + c = y',可以发现两点连边为抛物线,而其他点都在这条线下方才满足题意,故而求一个上凸壳即可. #i ...