Error while taking input

Currently, my code is taking correct input for only two rows and then, some absurd values are coming. Why is it so?

Link : https://ide.codingblocks.com/s/141647

https://ide.codingblocks.com/s/142206 Error observed while submitting code ----> Output : Compiling failed with exitcode 1, compiler output: prog.cpp:1:1: error: ‘import’ does not name a type; did you mean ‘short’? import java.util.Scanner; ^~~~~~ short prog.cpp:2:1: error: expected unqualified-id before ‘public’ public class Main {


Check for the comment in the above code