不合并符串
#include <iostream>
#include <string>
using namespace std;
int main()
{
string a, b;
while (cin >> a >> b)
{
for (int i = 0, j = b.length() - 1, k = 1; k <= a.length() + b.length(); k++)
{
if (k % 2 != 0)
cout << a[i++];
else
cout << b[j--];
}
cout << endl;
}
}
登录后发布评论
暂无评论,来抢沙发