Advertisement
Guest User

35

a guest
May 27th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. // 35
  2. #include <iostream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. /*
  8. ั‚ะตัั‚
  9. ss aa aab a b hhhh ss d sd sdd asdd nsha reol asa sd
  10. */
  11.  
  12. int main()
  13. {
  14.     int maxSize = 0;
  15.     string word, str = "";
  16.     while(cin >> word){
  17.         if(word.size() > maxSize){
  18.             maxSize = word.size();
  19.             str.erase();
  20.             str += word + " ";
  21.             continue;
  22.         }
  23.         if(word.size() == maxSize){
  24.             str += word + " ";
  25.             continue;
  26.         }
  27.     }
  28.     cout << str;
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement