Guest User

Untitled

a guest
Nov 1st, 2021
35
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data