解题说明:模拟题,按照要求输出即可,可以每两位输出一次,最后输出三位即可。
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include <algorithm>
#include<cstring>
#include<string>
using namespace std;
int main()
{
int n,i;
string a;
cin >> n;
cin >> a;
for (i = 0; i<n; i++)
{
cout << a[i];
if (i % 2 && n - i - 1>1)
{
cout << '-';
}
}
cout << endl;
return 0;
}