Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args)
- {
- Scanner UI = new Scanner(System.in);
- String save = "";
- int last = -1;
- System.out.println("Enter number");
- int userNum = UI.nextInt();
- while(last < userNum)
- {
- save += userNum + ", ";
- System.out.println("Enter number that is bigger than last");
- last = userNum;
- userNum = UI.nextInt();
- }
- System.out.println(save);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement