Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- import java.io.*;
- public class Main{
- public static PrintStream saida=System.out;
- public static Scanner sc=new Scanner(System.in);
- public static int ioup;
- public static boolean func(int x){
- if(ioup==1){
- if(x%2==0)
- return true;
- }
- else {
- if(x%2!=0)
- return true;
- }
- return false;
- }
- public static void main(String[] args) {
- ioup=sc.nextInt();
- int j1=sc.nextInt();
- int j2=sc.nextInt();
- int roub=sc.nextInt();
- int acus=sc.nextInt();
- int soma=j1+j2;
- boolean vitoria=true;
- if(roub==0&&acus==0){
- vitoria=func(soma);
- }
- if(roub==1&&acus==0) vitoria=true;
- else if (roub==1&&acus==1){
- vitoria=false;
- }
- if(vitoria==true)saida.println("Jogador 1 ganha!");
- else saida.println("Jogador 2 ganha!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement