0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-26 20:32:00 +00:00
OI-codes/Codeforces/25/B/B.cpp

21 lines
421 B
C++
Raw Normal View History

2020-10-23 08:22:43 +00:00
#include <bits/stdc++.h>
using namespace std;
int main() {
2021-11-19 09:01:13 +00:00
int n;
2020-10-23 08:22:43 +00:00
string s;
cin >> n >> s;
for (int i = 0; i < n; i++) {
cout << s[i];
if (i % 2 && n % 2 && i < n - 4 || i % 2 && !(n % 2) && i != n - 1) {
cout << '-';
}
if (i == n - 4 && n % 2) {
cout << '-' << s[n - 3] << s[n - 2] << s[n - 1];
break;
}
}
return 0;
}