GUVI
Back

CODEKATA Q2. input/ output

Created 3 years ago
1138 Views
2 Comments
PrawinRajanN
@PrawinRajanN
PrawinRajanN
@PrawinRajanNProfile is locked. Login

My code is executing fine. It produced excepted output as actual output. but it show error. i don't why. could you help me.

import java.util.Scanner;

import java.util.*;

public class Main {

public static void main(String[] args) {

Scanner obj = new Scanner(System.in);

obj.useDelimiter(" ");

int[] array=new int[7];

for(int i=0;i<7;i++){

array[i]=obj.nextInt();

}

for(int i=0;i<7;i++){

System.out.print(array[i]+" ");

}

}

}

The following output I got while submitting my code.

Testcase Status:
>>> error
Input:
2 3 4 5 6 7 8
Expected Output:
2 3 4 5 6 7 8
Actual Output:
2 3 4 5 6 7 8 

I had tired different ways. but i got this again & again. help me to clear this problem

after that I noticed empty space is my issue. Now, I fixed it.

Comments (2)
Please login to comment.
 
Powered by habitate.io Habitate