#include <string>
#include <iostream>
using namespace std;
int main()
{
size_t i, j;
string str1 = "ab125cdEfKOWg";
string str2 = "rtydeb";
string sout;
cout<<"str1 : "<<str1<<endl;
cout<<"str2 : "<<str2<<endl;
for( i = 0; i < str1.length(); i++ )
{
if( isalpha(str1[i]) )//символ является буквой?
if( islower(str1[i]) )//строчная ли буква
if( str2.find(str1[i], 0) == string::npos )//Ищем символ не входящий во 2-ую строку
if( sout.find(str1[i], 0) == string::npos )//Выходная строка не содержит указанный символ
sout += str1[i];
}
//Сортировка
for( i = 0; i < sout.length(); i++ )
for( j = i + 1; j < sout.length(); j++ )
{
if( sout[i] < sout[j] )
swap(sout[i], sout[j]);
}
cout<<"sout : "<<sout<<endl;
cin.get();
return 0;
}