![]() |
#2
qq8977934232016-10-10 18:32
|
只有本站会员才能查看附件,请 登录
只有本站会员才能查看附件,请 登录
为什么读取的时候如果再敲完数字之后回车,下一句s.nextLine()就无法读取到东西了呢?
源代码:
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner s = new Scanner(System.in);
int t = s.nextInt();
String str = s.nextLine();
for(int i = 0;i < t;++i){
System.out.print(str);
}
}
}