galinyotsev123

ProgBasicsJavaBook7.1ComplexLoop12breakSum

Jan 14th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class E12breakSum {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. boolean hasToEnd = false;
  8. for (int i = 1; i <= 3; i++) {
  9. if (hasToEnd == false){
  10. for (int j = 3; j >= 1 ; j--) {
  11. if (i + j == 2){
  12. hasToEnd = true;
  13. break;
  14. }
  15. System.out.println(i + " " + j);
  16. }
  17. }
  18. }
  19.  
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment