如圖,做出圖中第6題。謝謝………………………………………………………………
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner mScan = new Scanner(System.in);
System.out.println("輸入");
String str = null;
do{
str = mScan.next();
if(str.equals("boy")){
System.out.println("帥哥");
}else if(str.equals("girl")){
System.out.println("美女");
}else{
if(!str.equals("over"))
System.out.println("你想什麼呢");
}
}
while(!str.equals("over"));
System.out.println("退出程序");
}