1084 Broken Keyboard
题意:给出两个字符串(有字母,数字和下划线_组成),第一个字符串str1是由键盘输入的字符串,第二个字符串str2是屏幕显示的字符串,问键盘有哪几个按键坏了,根据输入的顺序,输出坏掉的键(仅输出一次)。要求输出字母为大写。
代码:
#include <cstdio>
#include <cstring>
#include <ctype.h>
int main()
{
], str2[];
]={false};//goodKeys[ch]为true表示字符ch为完好的键
scanf("%s",str1);
scanf("%s",str2);
int len=strlen(str2);
;i<len;i++){
str2[i]=toupper(str2[i]);//小写转大写
goodKeys[str2[i]]=true;
}
len=strlen(str1);
;i<len;i++){
str1[i]=toupper(str1[i]);
if(goodKeys[str1[i]]==false) {
goodKeys[str1[i]]=true;
printf("%c",str1[i]);
}
}
;
}
1084 Broken Keyboard的更多相关文章
- PAT 1084 Broken Keyboard
1084 Broken Keyboard (20 分) On a broken keyboard, some of the keys are worn out. So when you type ...
- 1084 Broken Keyboard (20 分)
1084 Broken Keyboard (20 分) On a broken keyboard, some of the keys are worn out. So when you type so ...
- PAT 1084 Broken Keyboard[比较]
1084 Broken Keyboard (20 分) On a broken keyboard, some of the keys are worn out. So when you type so ...
- 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 1084 Broken Keyboard(20 分)
1084 Broken Keyboard(20 分) On a broken keyboard, some of the keys are worn out. So when you type som ...
- 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 1084 Broken Keyboard (20) [Hash散列]
题目 On a broken keyboard, some of the keys are worn out. So when you type some sentences, the charact ...
- PAT (Advanced Level) 1084. Broken Keyboard (20)
简单题. #include<cstdio> #include<cstring> #include<cmath> #include<vector> #in ...
- 1084. Broken Keyboard (20)-水题
#include <iostream> #include <cstdio> #include <string.h> #include <algorithm&g ...
随机推荐
- Spring中Bean的生命周期是怎样的
1.Spring对Bean进行实例化(相当于程序中的new Xx()) 2.Spring将值和Bean的引用注入进Bean对应的属性中 3.如果Bean实现了BeanNameAware接口,Sprin ...
- 判断浏览器是否支持某一个CSS3属性
判断浏览器是否支持某一个CSS3属性 function supportCss3(style) { var prefix = ['webkit', 'Moz', 'ms', 'o'], i, humpS ...
- SQL正则表达式
(转自:http://blog.csdn.net/xu1314/article/details/10174067) 当我们要进行一些简单的糊涂查询时用百分号(%),通配符(_)就可以了.其中%表达任意 ...
- shell编程学习1
1.shell是操作系统的终端命令行 (1)shell可以理解为软件系统提供给用户操作的命令行界面,可以说它是人机交互的一种方式. (2)我们可以使用shell和操作系统.uboot等软件系统进 ...
- Struts04---命名空间的查询顺序以及默认执行的Action
01.创建login.jsp <%@ page language="java" import="java.util.*" pageEncoding=&qu ...
- WMS专业名词解释
1.摘果:按照单一客户上订单的内容进行拣选货品(即去货位上拣货),拣选完成后即可直接进行质检.包装. 2.播种:将多个客户订单上的货品进行汇总,然后对这些货品进行拣选.拣选完成后,再区分出每一个客户的 ...
- 事件穿透父层 直达子层 pointer-events:none
之前我也做过一些canvas特效,往往在canvas全屏时,canvas下层的div就无法进行dom的事件操作,点击之类的就失灵了.之前我的做法要么就是在canvas上加入点击事件,穿透到下层,或者把 ...
- what is out of band mode.
Most of the steps are the same, except instead of sending an URL as the oauth_callback to request_to ...
- Unity3d 背景、音效 播放 简单demo
仅实现功能,AudioListener在MainCamera中 using UnityEngine; using System.Collections; using System.Collection ...
- hexo多主题切换
今天看到一个朋友在github上面的issue 大概问题就是怎么在不同的电脑上面使用 git有个这么个东西Submoudle中文叫做子模块 具体使用教程看这里Git-工具-子模块 这里只说怎么搞hex ...