Skip to content

Instantly share code, notes, and snippets.

@pepet96
Created December 2, 2013 01:24
Show Gist options
  • Save pepet96/7743478 to your computer and use it in GitHub Desktop.
Save pepet96/7743478 to your computer and use it in GitHub Desktop.
Godzilla vs Mecha-Godzilla (Long Version)
import java.util.Scanner;
public class ArmyStrength {
public static void main (String [] args) {
Scanner input = new Scanner(System.in);
int godzillaMayor = 0, mechaMayor = 0;
String[] winners = new String[input.nextInt()];
for (int casos = 0; casos < winners.length; casos++) {
input.nextLine();
int godzillaNumbers = input.nextInt();
int mechaNumbers = input.nextInt();
for (int i = 0; i < godzillaNumbers; i++) {
int p = input.nextInt();
if (p > godzillaMayor)
godzillaMayor = p;
}
for (int i = 0; i < mechaNumbers; i++) {
int q = input.nextInt();
if (q > mechaMayor)
mechaMayor = q;
}
if (godzillaMayor >= mechaMayor)
winners[casos] = "Godzilla";
else
winners[casos] = "MechaGodzilla";
}
for (int i = 0; i < winners.length; i++) {
System.out.println(winners[i]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment