PRoblem Description 給定兩個字符串string1和string2,將字符串string2連接在string1的后面,并將連接后的字符串輸出。 連接后字符串長度不超過110。 Input 輸入包含多組數據,每組測試數據包含兩行,第一行代表string1,第二行代表string2。
Output 對于每組輸入數據,對應輸出連接后的字符串,每組輸出占一行。
Example Input
123654abssfgExample Output
123654abssfgHint
Author 趙利強
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <bits/stdc++.h> #define N 120 int main() { char str[ 240] = {0}; char ptr[ N ] = {0}; int next[ N ]; int slen, plen; while( ~scanf( "%s%s", str, ptr) ) { slen=strlen(str); plen=strlen(ptr); for(int a=0;a<plen; a++) str[slen++]=ptr[a]; str[slen]='/0'; printf("%s/n", str); } return 0; }新聞熱點
疑難解答