求解字节笔试的输入问题(java)
第三题签字问题的输入不知道行数,怎么能让数据在回车后输入结束?下面做***多个空行,测试时提示数组下标越界
Scanner sc =new Scanner(System.in);
String str;
while((str=sc.nextLine()).length()!=0){
if(str.equals(""))
break;
} Scanner sc =new Scanner(System.in);
String str;
while((str=sc.nextLine()).length()!=0){
if(str.equals(""))
break;
} 相关推荐
招聘动态