网站项目建设合同,温州瓯海建设局网站,流媒体网站建设规划,阜宁网站设计给定两个字符串 A 和 B#xff0c;本题要求你输出 AB#xff0c;即两个字符串的并集。要求先输出 A#xff0c;再输出 B#xff0c;但重复的字符必须被剔除。 输入格式#xff1a; 输入在两行中分别给出 A 和 B#xff0c;均为长度不超过 106的、由可见 ASCII 字符… 给定两个字符串 A 和 B本题要求你输出 AB即两个字符串的并集。要求先输出 A再输出 B但重复的字符必须被剔除。 输入格式 输入在两行中分别给出 A 和 B均为长度不超过 106的、由可见 ASCII 字符 (即码值为32~126)和空格组成的、由回车标识结束的非空字符串。 输出格式 在一行中输出题面要求的 A 和 B 的和。 输入样例 This is a sample test
to show you_How it works输出样例 This ampletowyu_Hrk#includeiostream
#includestring
using namespace std;
bool hashTable[130] {0};void print(string s){for(int i 0; i s.length(); i){if(hashTable[s[i]] false){cout s[i];hashTable[s[i]] true;}}
}int main(){string s;getline(cin,s);print(s);// getchar();getline(cin,s);//cin s;print(s);return 0;
} 转载于:https://www.cnblogs.com/wanghao-boke/p/10458822.html