Compare commits

..

No commits in common. '3e3c0036bfdb834202aa0b2a2e658d35b620b1f5' and 'a275f8ab87e5a3eb52367a4f524242f8dc9fc45d' have entirely different histories.

  1. 26
      удаление пробелов.txt

@ -1,26 +0,0 @@
#include <bits/stdc++.h>
using namespace std;
int main()
{
string str;
getline(cin, str);
int flag = 0;
for (int i = 0; i < str.size(); i++){
if (str[i] != ' ') {
cout << str[i];
flag = 1;
}
if (str[i] == ' ' && flag == 0) {
continue;
}
if (str[i] == ' ' && i+1 < str.size() && flag == 1) {
if (str[i+1] != ' ') {
cout << str[i];
}
}
}
return 0;
}
Loading…
Cancel
Save