я заменяю на рандомную прописную
C++ |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| #include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int main(){
srand(time(NULL));
char str[] = "Ajhd hhjd Ahjd Fhmd wWmsdmn Rnc";
if(str[0] >= 'A' && str[0] <= 'Z'){
str[0] = ('a' + rand() % ('z' - 'a'));
cout<<str[0];
}
for(int i = 1; str[i]; i++){
if(str[i] == ' '){
str[i+1] = ('a' + rand() % ('z' - 'a'));
cout<<str[i+1];
}
cout<<str[i];
}
return 0;
} |
|