首页 > 学院 > 开发设计 > 正文

1084

2019-11-11 03:01:49
字体:
来源:转载
供稿:网友
#include<cstdio>#include<cstring>#include<iostream>#include<algorithm>using namespace std;int main(){	int key[128] = { 0 };	char str1[85];	char str2[85];	scanf("%s%s", str1, str2);	int len1 = strlen(str1);	int len2 = strlen(str2);	for (int i = 0; i < len2; i++){		if (str2[i] >= 'a'&&str2[i] <= 'z'){			key[str2[i]] = 1;			key[str2[i] - 32] = 1;		}		else{			if (str2[i] >= 'A'&&str2[i] <= 'Z'){				key[str2[i]] = 1;				key[str2[i] + 32] = 1;			}			else{				key[str2[i]] = 1;			}		}	}	for (int i = 0; i < len1; i++){		if (!key[str1[i]]){			if (str1[i] >= 'a'&& str1[i] <= 'z'){				PRintf("%c", str1[i] - 32);				key[str1[i]] = 1;				key[str1[i]-32] = 1;			}			else{				if (str1[i] >= 'A'&& str1[i] <= 'Z'){					printf("%c", str1[i]);					key[str1[i]] = 1;					key[str1[i] + 32] = 1;				}				else{					printf("%c", str1[i]);					key[str1[i]] = 1;				}			}		}	}	return 0;}
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表