算法训练 连接字符串
时间限制:1.0s 内存限制:512.0MB
编程将两个字符串连接起来。例如country与side相连接成为countryside。
输入两行,每行一个字符串(只包含小写字母,长度不超过100);输出一行一个字符串。
输入两行,每行一个字符串(只包含小写字母,长度不超过100);输出一行一个字符串。
样例输入
country
side
side
样例输出
countryside
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc=new Scanner(System.in); StringBuffer bf=new StringBuffer(sc.next()); bf.append(sc.next()); System.out.println(bf); } }