AlbertMourato

Untitled

Nov 24th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.09 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main(){
  5.     string especiais;
  6.     string frase;
  7.     string aux1;
  8.     string palavra;
  9.     string aux2;
  10.     int n,v = 0,k = 0, a = 0;
  11.     bool existe  = false;
  12.     cin>>n;
  13.     while(n>0){
  14.         cin>>k;
  15.         cin>>a;
  16.         while(a>0){
  17.             existe = false;
  18.             getline(cin,especiais);
  19.             istringstream junto(especiais);
  20.             getline(cin, frase);
  21.             istringstream especiais(frase);
  22.             while(junto>>aux1){
  23.                 while(especiais>>aux2){
  24.                     if(aux1==aux2){
  25.                         existe = true;
  26.                         break;
  27.                     }
  28.                 }
  29.                 if(!existe){
  30.                     aux1[0]=tolower (aux1[0]);
  31.                     cout<<aux1[0];
  32.                     int z = 1;
  33.                     while(z<aux1.length()){
  34.                         aux1[z]=toupper (aux1[z]);
  35.                         cout<<aux1[z];
  36.                     }
  37.                 }
  38.             }
  39.             a--;
  40.         }
  41.         n--;
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment