Run ID:138547

提交时间:2025-11-27 14:37:02

#include<iostream> // cin\cout\endl #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() using namespace std; int main(){ int num = 0; cin >> num; char word1[100] = {0}; char word2[100] = {0}; int len1 = 0; int len2 = 0; for(int i = 0; i < num; i++) { cin >> word1; cin >> word2; len1 = strlen(word1);//2 len2 = strlen(word2);//2 //3 0 for(int j = 0; j < len1/2;j++) word1[len1+len2-1-j] = word1[len1-1-j]; for(int j = 0;j<len2;j++) word1[len1/2+j] = word2[j]; } for(int i = 0; i <=len2+len1;i++) cout << word1[i]; return 0; }