Advertisement
Guest User

Untitled

a guest
Nov 1st, 2021
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.36 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.     public static void main(String[] args) {
  5.         //Scanner scanner = new Scanner(System.in);
  6.         for (int i = 2; i <= 1000; i++) {
  7.             if (i % 2 == 0) {
  8.                 System.out.println(i);
  9.             } else {
  10.                 System.out.printf("-%d%n", i);
  11.             }
  12.             }
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement