import java.util.*;
class Example {
public static void main(String args[]) {
Scanner input = new Scanner(System.in);
System.out.print("number of rooms:");
int rooms = input.nextInt();
int count = 0;
for(int i = 0; i < rooms; i++) {
System.out.print("room capacity-q:");
int q = input.nextInt();
System.out.print("current space of the room-p:");
int p = input.nextInt();
if ((q - p) >= 2) {
count += 1;
}
}
System.out.println("no.rooms for thusitha & chamod is:"+count);
}
}
我收到一个名为class not error的错误。想知道是什么原因。