deyanivanov966

03. Numbers 1...N with Step 3

Oct 2nd, 2020 (edited)
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.30 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner scanner=new Scanner(System.in);
  7.  
  8.         int n = Integer.parseInt(scanner.nextLine());
  9.  
  10.         for (int i = 1; i <=n ; i+=3) {
  11.             System.out.println(i);
  12.         }
  13.  
  14.  
  15.     }
  16.  
  17. }
  18.  
Add Comment
Please, Sign In to add comment