Question:Input
2
5
1 2 3 4 5
7
5 1 4 6 8 1 4
Output
1 2 3 4 5
5 1 4 6 8 1 4
import java.util.*;
import java.io.*;
public class Main {
public static void main(String args[]) throws IOException {
Scanner sc= new Scanner(System. in);
int T=sc.nextInt();
for(int i=0;i<T;i++)
{
int n=sc.nextInt();
int arr[]= new int[n];
for(int j=0;j<n;j++)
arr[j]=sc.nextInt();
for(int j=0;j<n;j++)
System.out.prin tln(arr[j]);
}
}
}
Output
1 2 3 4 5 5 1 4 6 8 1 4
How can i get correct output here?
2
5
1 2 3 4 5
7
5 1 4 6 8 1 4
Output
1 2 3 4 5
5 1 4 6 8 1 4
import java.util.*;
import java.io.*;
public class Main {
public static void main(String args[]) throws IOException {
Scanner sc= new Scanner(System. in);
int T=sc.nextInt();
for(int i=0;i<T;i++)
{
int n=sc.nextInt();
int arr[]= new int[n];
for(int j=0;j<n;j++)
arr[j]=sc.nextInt();
for(int j=0;j<n;j++)
System.out.prin tln(arr[j]);
}
}
}
Output
1 2 3 4 5 5 1 4 6 8 1 4
How can i get correct output here?
Comment