Ir ao conteúdo
  • Cadastre-se

mergsnevus

Membro Júnior
  • Posts

    1
  • Cadastrado em

  • Última visita

Reputação

0
  1. #include<bits/stdc++.h> using namespace std; int main() { string s,s1; while(cin >> s >> s1){ cin.ignore(); set < char > let; bool b = false; string input,word,word1; getline(cin,input); transform(s.begin(),s.end(),s.begin(), ::tolower); for(int i = 0; i < s.size() ;i++) let.insert(s); for(int i = 0; i < input.size() ;i++){ if(isalpha(input) or (input >= '0' and input <= '9')){ word += input; word1 = word; transform(word1.begin(),word1.end(),word1.begin(), ::tolower); if(word1 == s and b){ cout << s1; word.clear(); word1.clear(); } if(word.size() == 1){ if(let.count(tolower(input)) == 0) { cout << input; word1.clear(); word.clear(); } } }else if(input == ' ' and word1 == s and b){ cout << s1 << " "; word.clear(); }else if(input == '>' and word1 == s and b){ cout << s1 << ">"; word.clear(); b = false; }else if(input == '<'){ b = true; (word.empty())? cout << '<' : cout << word << "<"; word.clear(); }else if(input == '>'){ (word.empty())?cout << '>' : cout << word << ">"; word.clear(); b = false; }else { (word.empty())? cout << input : cout << word << input; word.clear(); } } if(!word.empty()) cout << word << endl; else cout << endl; } return 0; }

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...