#include <iostream>#include <string>using namespace std;int main(){ string S; cin >> S; int Mass[52]; for (int i = 0; i < 52; i++) { Mass[i] = 0; } for (int i = 0; i < S.length(); i++) { char c = S[i]; if (c >= 'a'&&c <= 'z') { Mass[(int)(c-'a')*2]++; } else if (c >= 'A'&&c <= 'Z'){ Mass[(int)(c-'A')*2+1]++; } } for (int i = 0; i < 52; i++) { for (int j = 0; j < Mass[i]; j++) { cout << (i % 2 == 0?(char)(i/2+'a'):(char)(i/2+'A')); } } return 0;}Пример работы программы:LKDKjgkjsdlfvkhnOLHDSKLJNFLjghlJNKSgbakjbjkHVLJhfvkjHVKJAyfjHLIhaLIUYGFLAkjbhdilAUGXIKJASILFYHGklajfbhliGFLKjblkJBDFIgiksjbnfowshKLJHaaaAAAAbbbbbbBddDDDfffffFFFFFggggGGGGhhhhhhhHHHHHHiiiIIIIIjjjjjjjjjjjJJJJJJJkkkkkkkkkKKKKKKKKllllllLLLLLLLLLLLnnNNoOsssSSSUUvvVVwXyYY