/**
連續錄入學生姓名,輸入“q”則系統退出
*/
import java.util.Scanner;
public class DoWhile2 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("請連續錄入學生姓名, 直到輸入q退出系統");
String name = "";
do {
name = in.nextLine();
} while (!name.equals("q"));
System.out.println("退出系統");
}
}
/*
while循環和do-while循環的差別?
*/