import java.util.Scanner;
public class parcialTorneo{
public static void main(String[]args){
String equi1;
String equi2;
int g1, p1, res1, res2;
equi1=(equi1.toUpperCase());
equi2=(equi2.toUpperCase());
Scanner Sc = new Scanner(System.in);
System.out.print(" Ingrese el nombre de los dos equipos:");
equi1=Sc.next();
equi2=Sc.next();
System.out.println("los equipos que jugarán son:" + equi1 + equi2);
if (equi1.equals(equi2)){
System.out.print(" los equipos no pueden jugar:");
} else {
System.out.println(" ingrese 1 si el equipo indicado hace gol o ingrese 0 si falla:");
int penal=0;
while(penal<5){
penal ++;
System.out.println(equi1 + penal);
g1=Sc.nextInt();
System.out.println(equi2 + penal);
p1=Sc.nextInt();
if(g1>p1){
System.out.println(equi1 + "ganó el juego");
}else if(g1<p1){
System.out.println(equi2 + "ganó el juego");
}else{
System.out.println("empate");
}
}
}
}
}
No hay comentarios:
Publicar un comentario