Преобразовать символьный массив, заменив все символы до первой запятой на символ ‘#’
Ответы на вопрос
Ответил MaxLevs
0
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
\Так как язык не указан, пишу на c++\
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
#include <iostream>
using namespace std;
int main() {
char s[] = "Oh, this is my beautiful obscura...";
size_t i = 0;
while (s[i] != ',' && s[i] != ' ') {
s[i] = '#';
i++;
}
cout << s << endl;
system("pause");
return 0;
}
\Так как язык не указан, пишу на c++\
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
#include <iostream>
using namespace std;
int main() {
char s[] = "Oh, this is my beautiful obscura...";
size_t i = 0;
while (s[i] != ',' && s[i] != ' ') {
s[i] = '#';
i++;
}
cout << s << endl;
system("pause");
return 0;
}
Новые вопросы