PTT
Submit
Submit
選擇語言
正體中文
简体中文
PTT
java
[問題] 二維陣列複製貼上輸入的問題
作者:
onejiko
(己摳)
2014-05-09 00:11:23
我想問當我一開始輸入3
再輸入三串數列都可以正常OUTPUT
1 2 3 4 5 6
2 3 4 5 6 1
3 4 5 6 1 2
但如果我是用複製貼上那三行數列的話
它卻不能完全抓取到三串數列這是怎麼回事?
(剛接觸JAVA的新手)
int i;
int num;
String str1;
System.out.println("請輸入n");
Scanner c = new Scanner(System.in);
num = c.nextInt();
String array[][] = new String[num][6];
for(int x=0;x<num;x++){
System.out.println(x);
Scanner scanner = new Scanner(System.in);
str1 = scanner.nextLine();
String str2[]=str1.split(" ");
i=0;
for(int y=0 ; y<6 ; y++ ){
array[x][y] = str2[i];
i++;
}
}
作者:
cyclone350
(老子我最神)
2014-05-09 00:29:00
is it?
" target="_blank" rel="nofollow">
繼續閱讀
Re: [公告] kobitos 軟性警告一次
AmosYang
Re: [公告] kobitos 軟性警告一次
IhateOGC
Re: [公告] kobitos 軟性警告一次
changyuheng
Re: [公告] kobitos 軟性警告一次
PsMonkey
Re: [公告] kobitos 軟性警告一次
changyuheng
Re: [公告] kobitos 軟性警告一次
PsMonkey
Re: [公告] kobitos 軟性警告一次
kobitos
[問題] 有人用過OSGi嗎?
blackohnny
Re: [問題] spring, 與架構問題
sbrhsieh
Re: [問題] 請問在GWT上用Google Map API
PsMonkey
Links
booklink
Contact Us: admin [ a t ] ucptt.com