public static void main (String[] args)
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
String[] sed1 = new String[n];
String[] sed2 = new String[n];
for(int i=0;i<n;i++){
sed1[i] = sc.nextLine();
sed2[i] = sc.nextLine();
}
System.out.println("OUTPUT:");
for(int j=0;j<3;j++){
System.out.print(sed1[j]);
System.out.print(" ");
System.out.print(sed2[j]);
System.out.println();
}
}
}
Gives the output after giving the input:
3
1 0 2
2 3 4
10 10 10
8 8 8
10 0 10
OUTPUT:
1 0 2
2 3 4 10 10 10
8 8 8 10 0 10
As you can see the first element in the array sed1 is empty, so how do I solve this issue