Guest User

Untitled

a guest
Jan 14th, 2016
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1.     import java.util.Scanner;
  2.  
  3.     public class Los3 {
  4.         public static void main(String[] args) {
  5.             System.out.print("Podaj liczbe początkową : ");
  6.             Scanner pocz = new Scanner(System.in);
  7.             int x;
  8.             x = pocz.nextInt();
  9.      
  10.             System.out.print("Podaj ilość generowanych liczb  : ");
  11.             Scanner ilosc = new Scanner(System.in);
  12.             int y;
  13.             y = ilosc.nextInt();
  14. for (int i = (x % 2) == 0 ? x : x + 1 ; y > 0; i = i + 2, y--) {
  15. System.out.println(i);
  16.             }
  17.         }
  18.     }
Advertisement
Add Comment
Please, Sign In to add comment