Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
138548 严鑫亮 墓碑上的字符 C++ Accepted 1 MS 280 KB 859 2025-11-27 14:43:03

Tests(2/2):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int num = 0; cin >> num; char word1[200] = {0}; char word2[100] = {0}; for(int i = 0; i < num; i++) { cin >> word1; cin >> word2; int len1 = strlen(word1); int len2 = strlen(word2); char temp[100] = {0}; strcpy(temp, word1 + len1/2); strcpy(word1 + len1/2, word2); strcat(word1, temp); cout << word1 << endl; memset(word1, 0, sizeof(word1)); memset(word2, 0, sizeof(word2)); } return 0; }