Help with this code??

I have been trying to solve the La Liga Problem “COOK82A” under beginner section. I wrote a code in Java and ran it against the given input along with some inputs of my own and the output was correct. But the compiler of code chef shows error. It would be a big help if somebody can tell me what is the error in the code.

Here is the code.

import java.util.Scanner;

class Laliga {
public static void main(String[] args){
	Scanner in = new Scanner(System.in);
	int n = in.nextInt();
	String[] teams = new String[4];
	int [] teamScore = new int[4];
	for(int a = 0;a<n;a++){
	for(int i=0;i<4;i++){
	String temp = in.next();
	int tempS = in.nextInt();
	//System.out.println(temp + " "+tempS);
	if(temp.equals("Barcelona")){
		teams[0] = temp;
		teamScore[0] = tempS;
		continue;
	}
	else if(temp.equals("Eibar")){
		teams[1] = temp;
		teamScore[1] = tempS;
		continue;
	}
	else if(temp.equals("RealMadrid")){
		teams[2] = temp;
		teamScore[2] = tempS;
		continue;
	}
	else if(temp.equals("Malaga")){
		teams[3] = temp;
		teamScore[3] = tempS;
		continue;
	 }
	}
	if(teamScore[0]>teamScore[1]&&teamScore[3]>teamScore[2]){
		System.out.println("Barcelona");
	}
	else
		System.out.println("ReadMadrid");
	}
	in.close();
	
}
}

Here is the error dear-

System.out.println("ReadMadrid");

Its RealMadrid not ReadMadrid

1 Like

oh god, thank you so much and here I was thinking I can never get my solutions right in first try -_- . Hahaha such a silly mistake.

1 Like

Hey dear, dont use award point feature to give points. That will subtract your points. If you ahve asked a question and someone answered it, then use “Accept answer” feature to give points, it will also give you points. Answers are accepted by clicking on that “Tick-in-circle-below-thumbs-down-button”

1 Like

oh lol, I did not know about that thanks, I noticed that some moments ago that it was showing [1] & now its showing [0] lol.