在这里插入代码片
```public class Test {
private static void positiveNumber(int a) {
Scanner scanner = new Scanner(System.in);
if ((a >1000)||(a<0)) {
System.out.println("请重新输入");
positiveNumber(scanner.nextInt());
} else {
System.out.println(Math.sqrt(a));
}
}
public static void main(String[]args){
Scanner scanner = new Scanner(System.in);
positiveNumber(scanner.nextInt());
}
}