Advertisement
Isaacmm

Untitled

Apr 22nd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class JavaApplication8 {
  4. private static Scanner scanner = new Scanner( System.in );
  5.  
  6. public static void main(String[] args) {
  7.  
  8. System.out.println("set A:");
  9. Integer a = new Integer(scanner.nextInt());
  10. System.out.println("set B");
  11. Integer b = new Integer(scanner.nextInt());
  12.  
  13. while(a!=b)
  14. {
  15. if (a>b)
  16. {
  17. a--;
  18. System.out.println(a);
  19. }
  20. if (a<b)
  21. {
  22. a++;
  23. System.out.println(a);
  24. }
  25. }
  26. }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement