Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class czterdziescijeden {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- System.out.println("Podaj liczbe wyrazów ciągu arytmetycznego o różnicy równej 3: ");
- int n = sc.nextInt();
- int ciag=1;
- for (int i=0; i<=n;i++){
- ciag+=3;
- }
- System.out.println("ciag arytmetyczny : "+ciag+"");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement