Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Los3 {
- public static void main(String[] args) {
- System.out.print("Podaj liczbe początkową : ");
- Scanner pocz = new Scanner(System.in);
- int x;
- x = pocz.nextInt();
- System.out.print("Podaj ilość generowanych liczb : ");
- Scanner ilosc = new Scanner(System.in);
- int y;
- y = ilosc.nextInt();
- for (int i = (x % 2) == 0 ? x : x + 1 ; y > 0; i = i + 2, y--) {
- System.out.println(i);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment