Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
while(true){
System.out.println(n);
}这代码输入1 输出为 一个1 (且程序不断运行)
Scanner sc=new Scanner(System.in);
int n;
while(true){
n=sc.nextInt();
System.out.println(n);
}
这代码输入1 后 不断输出1,(且程序不断运行)
为什么会这样,都应该不断输出1的吗。谢谢
韭菜馅糖包
相关分类