dimanche 25 mai 2014

How to compare values from keyboard input? JAVA


Vote count:

0




How could I compare two values from the keyboard input? I mean, I have this code:



int row, col;
for (int i = 1; i <= movements; i++) {
row = scan.nextInt();
col = scan.nextInt();
}


Imagine that I have 4 movements, for example: 1 1 , 1 2 , 2 1 , 2 2 . I want to compare if second movement (1 2) is equals to first (1 1), third (2 1) to second (1 2)...


How can I do that? Thanks.



asked 15 secs ago






Aucun commentaire:

Enregistrer un commentaire