//Nayeem Shahriar Joy,Applied Physics & Electronic Engineering, University of Rajshahi.
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Joy{
public static void main(String[] args) {
// Get input from the user w/ sentinel logic
Scanner in = new Scanner(System.in);
String s=in.nextLine();
String[]values=s.split(" ");
int a=Integer.parseInt(values[0]);
int b=Integer.parseInt(values[1]);
if(a<b&&(b-a)!=1)
{
System.out.println("Dr. Chaz will have "+(b-a)+" pieces of chicken left over!");
}
else if(a<b&&(b-a)==1)
{
System.out.println("Dr. Chaz will have "+(b-a)+" piece of chicken left over!");
}
else if(a>b&&(a-b)!=1)
{
System.out.println("Dr. Chaz needs "+(a-b)+" more pieces of chicken!");
}
else if(a>b&&(a-b)==1)
{
System.out.println("Dr. Chaz needs "+(a-b)+" more piece of chicken!");
}
}
}
No comments:
Post a Comment