-
Notifications
You must be signed in to change notification settings - Fork 0
/
nowcodePat1023.cpp
60 lines (57 loc) · 918 Bytes
/
nowcodePat1023.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>
using namespace std;
char ch[100005] = {0};
char ch2[100005] = {0};
//int flag = 0;
int judge(char c){
char temp;
int counter = 0;
temp = c;
if(temp <= 'z' && c>='a'){
temp = c - 32;
}
for(int i = 0; i < strlen(ch); i++){
if(temp == ch[i]){
counter++;
}
}
if(counter==0){
return 1;
}else{
return 0;
}
}
int main(){
scanf("%s",ch);
scanf("%s",ch2);
int counter = 0;
int flag = 0;
for(int i = 0; i < strlen(ch); i++){
if(ch[i] == '+'){
flag = 1;
}
}
for(int i = 0; i < strlen(ch2); i++){
if(judge(ch2[i])){
if(flag == 1){//È«²¿Ð¡Ð´
if(ch2[i] <= 'Z' && ch2[i] >= 'A'){
counter++;
// printf("%c",ch2[i]+32);
}else{
counter++;
printf("%c",ch2[i]);
}
}else{
printf("%c",ch2[i]);
counter++;
}
}
}
if(counter == 0){
printf("_");
}
printf("\n");
return 0;
}