Merge pull request 'main' (#1) from main into name_of_branch
Reviewed-on: https://cs-shelter.xyz/Mikhail/boom/pulls/1name_of_branch
commit
3e3c0036bf
@ -0,0 +1,26 @@ |
||||
#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…
Reference in new issue