請問一下這樣寫有錯誤嗎?
public class D673 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int c=0;
while (input.hasNext()) {
c++;
int p=input.nextInt();
if(p<0) break;
System.out.println("Case "+c+":");
int d[]=new int[12];
for(int i=0;i<12;i++){
d[i]=input.nextInt();
}
//
for(int i=0;i<12;i++){
int tmp=input.nextInt();
System.out.println(p<tmp? "No problem. :(":"No problem! :D");
p+=d[i];
}
}
}
}