-
Notifications
You must be signed in to change notification settings - Fork 1
/
AL_16_02.cpp
executable file
·70 lines (46 loc) · 862 Bytes
/
AL_16_02.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <string>
#include <algorithm>
#define FOR(i,a,b) for(long long i = a ; i < b ; ++i )
#define PB push_back
#define VI vector<int>
using namespace std;
int main(){
string s;
vector< char > help ;
while( getline( cin , s ) ){
int it = 0 ;
int it2 = 0 ;
help.clear();
help = vector< char >();
while( it < s.length() ){
if( s[ it ] != ' ' )
help.PB( s[ it ] );
else
break;
it++;
}
it++;
if( help.size() > 0 ) cout << help[ it2 ];
it2++;
while( it < s.length() ){
if( s[it] == ' ' ){
cout << ' ';
if( it2 < help.size() )cout << help[ it2++ ];
}
else{
cout << s[ it ];
}
it++;
}
cout << "\n";
}
return 0 ;
}
// BBBB EKA EKA EKA EKA