Full width home advertisement

Travel the world

Climb the mountains

Post Page Advertisement [Top]

Java

Solving Taketwostones open.kattis.com with Java

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package taketwostones;
import java.util.Scanner;
/**
 *
 * @author user
 */
public class Taketwostones {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        int N;
        Scanner input = new Scanner(System.in);
        N = input.nextInt();
        int A = N%2;
        if(A==0){
            System.out.println("Bob");
        }else{
            System.out.println("Alice");
        }
    }
 
}
Program diatas yang sudah saya berikan,anda dapat mencoba dengan sendirinya !!!








No comments:

Post a Comment

Bottom Ad [Post Page]

| Designed by Colorlib