PAT A1084 broken keyboard (20)
来源:互联网 发布:儿歌软件哪个好 编辑:程序博客网 时间:2024/06/05 11:35
#include<cstdio>
#include<cstring>
int main(){
char input[85],output[85];
int check[37]={0};
int len1,len2,i,j=0;
scanf("%s",input);
scanf("%s",output);
len1=strlen(input);
len2=strlen(output);
for(i=0;i<len1;i++){
if(input[i]==output[j]) j++;
else{
if(input[i]<='Z' && input[i]>='A'){
if(check[input[i]-'A']!=1){
printf("%c",input[i]);
check[input[i]-'A']=1;
}
}else if(input[i]>='0' && input[i]<='9'){
if(check[input[i]-'0'+26]!=1){
printf("%c",input[i]);
check[input[i]-'0'+26]=1;
}
}else if(input[i]=='_'){
if(check[36]!=1){
printf("_");
check[36]=1;
}
}else if(input[i]>='a' && input[i]<='z'){
if(check[input[i]-'a']!=1){
printf("%c",input[i]-'a'+'A');
check[input[i]-'a']=1;
}
}
}
}
return 0;
}
#include<cstring>
int main(){
char input[85],output[85];
int check[37]={0};
int len1,len2,i,j=0;
scanf("%s",input);
scanf("%s",output);
len1=strlen(input);
len2=strlen(output);
for(i=0;i<len1;i++){
if(input[i]==output[j]) j++;
else{
if(input[i]<='Z' && input[i]>='A'){
if(check[input[i]-'A']!=1){
printf("%c",input[i]);
check[input[i]-'A']=1;
}
}else if(input[i]>='0' && input[i]<='9'){
if(check[input[i]-'0'+26]!=1){
printf("%c",input[i]);
check[input[i]-'0'+26]=1;
}
}else if(input[i]=='_'){
if(check[36]!=1){
printf("_");
check[36]=1;
}
}else if(input[i]>='a' && input[i]<='z'){
if(check[input[i]-'a']!=1){
printf("%c",input[i]-'a'+'A');
check[input[i]-'a']=1;
}
}
}
}
return 0;
}
0 0
- pat-a1084. Broken Keyboard (20)
- PAT A1084. Broken Keyboard (20)
- PAT A1084 broken keyboard (20)
- PAT-A1084. Broken Keyboard (20)(模拟)
- PAT Broken Keyboard (20)
- pat 1084. Broken Keyboard (20)
- PAT 1084. Broken Keyboard (20)
- PAT 1084. Broken Keyboard (20)
- pat 1084. Broken Keyboard (20)
- PAT 1084. Broken Keyboard (20)
- 【PAT】1084. Broken Keyboard (20)
- 1084. Broken Keyboard (20) PAT
- PAT A 1084. Broken Keyboard (20)
- 1084. Broken Keyboard (20)-PAT甲级试题
- PAT(甲级)1084. Broken Keyboard (20)
- PAT甲级练习1084. Broken Keyboard (20)
- PAT-A 1084. Broken Keyboard (20)
- 1084. Broken Keyboard (20)(PAT甲)
- C++关键字(1)
- theano reshape -1
- twbsPagination分页插件
- Ural 2072 Kirill the Gardener 3
- 整合Kafka到Spark Streaming——代码示例和挑战
- PAT A1084 broken keyboard (20)
- android studio library下引用aar失败的问题?
- 假如让我重新做一个Android App
- javascript经典例子--客户端校验
- 开发帮助工具库 可查看网络请求 收集carsh 切换服务器
- python内建函数
- iOS - 图文混排(支持图片文字混排,网址@#话题#以及自定义链接,关键字高亮等)
- Git分支使用规范
- redis使用