You are viewing a single comment's thread. Return to all comments →
public static void main(String[] args) { Scanner scan = new Scanner(System.in); int i = scan.nextInt(); double d = scan.nextDouble(); System.out.print("String: "); while(scan.hasNext()) { String s = scan.nextLine(); System.out.print(s); } System.out.println("\nDouble: " + d); System.out.println("Int: " + i); scan.close(); }
Seems like cookies are disabled on this browser, please enable them to open this website
Java Stdin and Stdout II
You are viewing a single comment's thread. Return to all comments →
public static void main(String[] args) { Scanner scan = new Scanner(System.in); int i = scan.nextInt(); double d = scan.nextDouble(); System.out.print("String: "); while(scan.hasNext()) { String s = scan.nextLine(); System.out.print(s); } System.out.println("\nDouble: " + d); System.out.println("Int: " + i); scan.close(); }