http://www.patest.cn/contests/pat-b-practise
分析: 简单题
代码:
<span style="font-size:14px;">//p1029 ╬и╪Эел
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstring>
#include <ctype.h>
using namespace std;
const int maxn = 100;
int n;
int vis[maxn];
string ans;
bool isexit(char c)
{
for(int i=0; i<ans.length(); i++){
if(ans[i] == c) return true;
}
return false;
}
int main()
{
// freopen("in.txt", "r", stdin);
int lena, lenb;
char a[maxn], b[maxn];
scanf("%s%s",a, b);
lena = strlen(a);
lenb = strlen(b);
for(int i=0; i<lena; i++){
if(islower(a[i])) a[i]=toupper(a[i]);
}
for(int i=0; i<lenb; i++){
if(islower(b[i])) b[i]=toupper(b[i]);
}
for(int i=0, j=0; i<lena; i++){
if(a[i] != b[j] ){
if(!isexit(a[i]))
ans += a[i];
}
else j++;
}
cout<<ans<<endl;
return 0;
}
</span>