Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class LuckyNumber{
  3. public static void main(String [] args){
  4. System.out.println("Enter your ticket number:");
  5. Scanner in = new Scanner(System.in);
  6. int[] nums = new int[6];
  7. for(int i=0;i <nums.length; i++){
  8. nums[i]=in.nextInt();
  9. }
  10.  
  11. if(nums[0]+ nums[1]+nums[2]== nums[3]+ nums[4]+nums[5]){
  12. System.out.println(" is lucky ");
  13. }
  14. else{
  15. System.out.println(" is unlucky ");
  16. }
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement