Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2014
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.78 KB | None | 0 0
  1. public static void main(String[] args) {
  2.  
  3.             // TODO code application logic here  
  4.             Scanner input = new Scanner(System.in);
  5.             System.out.println("Insert the 4 values in the same line");
  6.             String firstTeam;
  7.             firstTeam = input.next();
  8.             String secondTeam;
  9.             secondTeam = input.next();
  10.             int Score1;
  11.             Score1 = input.nextInt();
  12.             int Score2;
  13.             Score2 = input.nextInt();
  14.  
  15.             if (Score1 > Score2)
  16.  
  17.                 System.out.println(firstTeam + "is the winning team");
  18.  
  19.             else if  (Score1 < Score2)
  20.  
  21.                 System.out.println(secondTeam + "is the winning team");
  22.  
  23.              else System.out.println("The match was a draw");
  24.  
  25.         }
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement