牛客周赛 Round 35(A,B,C,D,E,F,G)-A 小红的字符串切割

时间:2024-03-04 13:01:30

思路:

记录一下字符串长度,然后从中间拆开。

code:

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

string s;

int main(){
	cin>>s;
	cout<<s.substr(0,s.length()/2)<<endl<<s.substr(s.length()/2);
	return 0;
}