https://www.hackerrank.com/challenges/java-stdin-stdout
Sample Input
42
3.1415
Welcome to Hackerrank Java tutorials!
Sample Output
String: Welcome to Hackerrank Java tutorials!
Double: 3.1415
Int: 42
정수, 실수, 문자열 순으로 입력받아 역순으로 출력하기.
보낸 답)
import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int i = sc.nextInt();
double d = sc.nextDouble();
sc.nextLine();
String s = sc.nextLine();
System.out.println("String: " + s);
System.out.println("Double: " + d);
System.out.println("Int: " + i);
}
}
'HackerRank > HR-Java' 카테고리의 다른 글
#6 Java Loops (0) | 2015.11.18 |
---|---|
#5 Java Output Formatting (0) | 2015.11.17 |
#3 Java If-Else (0) | 2015.11.17 |
#2 Java Stdin and Stdout 1 (0) | 2015.11.17 |
#1 Welcome to Java! (0) | 2015.11.17 |