Guest User

Untitled

a guest
Dec 6th, 2019
81
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Scanner s = new Scanner (System.in);
  2.  
  3.  
  4. int sum = 0;
  5. int previous = 0;
  6. int number = 0;
  7.  
  8.  
  9. do{sum += number;
  10. previous = number;
  11.  
  12. System.out.print("Next: ");
  13. number = s.nextInt();
  14.  
  15. } while (previous <= number);
  16.  
  17. System.out.println("Result:" + sum);
RAW Paste Data