+ 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
4 RĂ©ponses
+ 2
Thank you very much!
+ 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++;}
}
}
+ 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.
0
Can anyone explain this line by line ?