I having this as
input
3
Hong Kong
India
Usa
12
130
20
And Expected output is
Hong Kong
Usa
India
12
20
130
But i'm getting the only Exception in thread "main" java.util.InputMismatchException
How to get the full string.
public class Main{
public static void main (String[] args) {
Scanner sc=new Scanner(System.in);
int no=sc.nextInt();
String[] cname=new String[no];
int[] pop=new int[no];
for(int i=0;i<no;i++){
cname[i]=sc.nextLine();
}
for(int i=0;i<no;i++){
pop[i]=sc.nextInt();
}