Bihim

Shootout at NDUB

Dec 18th, 2016
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Shoot
  3. {
  4.  
  5.     public static void main (String arg[])
  6.     {
  7.    
  8.     Scanner shoot = new Scanner(System.in);
  9.    
  10.     int harry = 0;
  11.    
  12.     int larry = 0;
  13.    
  14.     int harry1, larry1, total = 10;
  15.    
  16.     System.out.println("Enter the number of cans which is shot by Harry and Larry respectively: ");
  17.    
  18.     harry = shoot.nextInt();
  19.     larry = shoot.nextInt();
  20.    
  21.     harry1 = total-harry;
  22.    
  23.     larry1 = total-larry;
  24.    
  25.     System.out.println("The number of cans which is not shot by Harry and Larry respectively are: ");
  26.    
  27.     System.out.println(harry1+" "+larry1);
  28.    
  29.     shoot.close();
  30.        
  31.     }
  32.    
  33.    
  34. }
Advertisement
Add Comment
Please, Sign In to add comment