Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class CiagArytmetyczny {
- public static void main(String[] args) {
- // zmienne
- int firstNumber = 1;
- Scanner reading = new Scanner(System.in);
- System.out.println("Podaj ilosc wyrazow ciagu");
- int amount = reading.nextInt();
- //odczyt
- int difference = 3;
- for (int i=1; i<=amount; i++){
- firstNumber = (firstNumber + difference);
- System.out.println(firstNumber);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement