L1-045 宇宙无敌大招呼
据说所有程序员学习的第一个程序都是在屏幕上输出一句“Hello World”,跟这个世界打个招呼。作为天梯赛中的程序员,你写的程序得高级一点,要能跟任意指定的星球打招呼。
输入格式:
输入在第一行给出一个星球的名字S
,是一个由不超过 7 个英文字母组成的单词,以回车结束。
输出格式:
在一行中输出Hello S
,跟输入的S
星球打个招呼。
输入样例:
tex
Mars
Mars
输出样例:
tex
Hello Mars
Hello Mars
Solution:
java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
System.out.printf("Hello %s", in.readLine());
}
}
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
System.out.printf("Hello %s", in.readLine());
}
}