+ 1

Could you check it correct or not?

import java.util.*; public class Program { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Nhap so luong SINH VIEN : "); int n = input.nextInt(); System.out.println(n); String[] ArrStr = new String[n]; int i=0; while (i<n){ System.out.print((i+1)+". "); ArrStr[i] = input.nextLine(); System.out.println(ArrStr[i]); i++;} // System.out.println("Chieu da

20th Jan 2017, 4:42 AM
Hữu Quyền Nguyễn
Hữu Quyền Nguyễn - avatar
4 RĂ©ponses
+ 2
Thank you very much!
20th Jan 2017, 5:52 AM
Hữu Quyền Nguyễn
Hữu Quyền Nguyễn - avatar
+ 1
import java.util.*; public class Program public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Nhap so luong SINH VIEN : "); int n = input.nextInt(); System.out.println(n); String[] ArrStr = new String[n]; int i=0; while (i<n){ System.out.print((i+1)+". "); ArrStr[i] = input.nextLine(); System.out.println(ArrStr[i]); i++;} } }
20th Jan 2017, 5:48 AM
Ahmed Elzoughby
Ahmed Elzoughby - avatar
+ 1
The code is correct, but solo learn has a bad way to take the user input. Try it on an IDE like eclipse or NetBeans.
20th Jan 2017, 5:51 AM
Ahmed Elzoughby
Ahmed Elzoughby - avatar
0
Can anyone explain this line by line ?
22nd Jan 2017, 11:42 AM
Prithiv
Prithiv - avatar