d066: 上學去吧!
題目:http://zerojudge.tw/ShowProblem?problemid=d066
程式碼:
程式碼:
import java.util.Scanner;
public class d066 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int hh = sc.nextInt();//輸入時
int mm = sc.nextInt();//輸入分
if(hh >=7 && hh<17){ //範圍7~17
if(hh == 7 && mm <30){//最早 7:30
System.out.println("Off School");
} else{
System.out.println("At School");
}
} else{
System.out.println("Off School");
}
}
}
}

留言
張貼留言