尝试一下(在循环外将变量声明为a):
int a = -1; do{ System.out.println("Enter a number between 0 an 10"); Scanner in = new Scanner(System.in); a = in.nextInt(); }while (a>0 && a<10);
欢迎分享,转载请注明来源:内存溢出
尝试一下(在循环外将变量声明为a):
int a = -1; do{ System.out.println("Enter a number between 0 an 10"); Scanner in = new Scanner(System.in); a = in.nextInt(); }while (a>0 && a<10);
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)