Created
          December 2, 2013 01:24 
        
      - 
      
- 
        Save pepet96/7743478 to your computer and use it in GitHub Desktop. 
    Godzilla vs Mecha-Godzilla (Long Version)
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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