压根不用拼接,直接输出就行。
字符串链接
https://www.nowcoder.com/practice/9f27c74ec91e4c7da96ba351dba235fc
//C语言版代码 #include <stdio.h> int main() { char s[100], t[100]; while (scanf("%s%s", s, t) != EOF) { printf("%s%s\n", s, t); } return 0; } //C++版代码 #include <iostream> using namespace std; int main() { string s, t; while (cin >> s >> t) { cout << s << t << endl; } return 0; } //Java版代码 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { String s = sc.next(); String t = sc.next(); System.out.println(s + t); } } } #Python版代码 while True: try: print(input().replace(' ', '')) except: break