👤

Se citeste de la tastatura un text. sa se scrie programul care elimina toate spatiile din text. ​

Răspuns :

#include <iostream>

#include <string>

using namespace std;

int main() {

char text[100];

cin.get(text, 100);

for (int i = 0; i < strlen(text); i++) {

 if (text[i] == ' ') strcpy(text + i, text + i + 1);

}

cout << text;

}

Vezi imaginea Andrei750238