package test1;
import java.util.*;
public class Demo {
public static void main(String[] args) {
int ex = (int) (Math.random()*100);
System.out.println(ex);
Scanner scan = new Scanner(System.in);
while(true) {
int in = scan.nextInt();
if(in==ex) {
System.out.println("Right!");
System.exit(0);
}
else {
System.out.println("Wrong!");
}
}
}
}
原文地址:https://www.cnblogs.com/Archerme/p/10459658.html
时间: 2024-10-27 01:05:05