package sec04.chap07;
import java.util.Scanner;
public class Ex01 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str1 = sc.next();
String str2 = sc.next();
String str3 = sc.nextLine();
System.out.println("str1: " + str1);
System.out.println("str2: " + str2);
System.out.println("str3: " + str3);
}
}
package sec04.chap07;
import java.util.Scanner;
public class Ex02 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("๋จ์ด๋ฅผ ์
๋ ฅํด์ฃผ์ธ์.");
while (sc.hasNext()) {
String nextWord = sc.next();
if (nextWord.equalsIgnoreCase("quit")) break;
System.out.println("์
๋ ฅ๊ฐ: " + nextWord);
}
// โญ ์ค์บ๋์ ์ฌ์ฉ์ด ๋๋๋ฉด OS์์์ ๋ฐํ
// ํ์ผ ๋ฑ์ผ๋ก๋ถํฐ ์ฝ์ด์ค๋๋ฐ ์ฌ์ฉ์ ํ์
sc.close();
}
}