Advertisement
dmitrytrc

Untitled

May 22nd, 2019
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <string>
  4. #include <vector>
  5.  
  6. using namespace std;
  7.  
  8. int main() {
  9.  
  10.     vector<string> S;
  11.     int N;
  12.     std::cin >> N;
  13.     if (N >= 0 and N <= 1000) {
  14.         for (auto i{0}; i < N; ++i) {
  15.             string s;
  16.             cin >> s;
  17.             if (s.size() >= 1 and s.size() <= 15) {
  18.                 sort(begin(s), end(s),
  19.                      [](char L, char R) {
  20.                          return tolower(L) < tolower(R);
  21.                      }
  22.                 );
  23.                 S.push_back(s);
  24.             }
  25.         }
  26.     }
  27.     for (auto &t : S) {
  28.         cout << t << " ";
  29.     }
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement