Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- //Scanner scanner = new Scanner(System.in);
- for (int i = 2; i <= 1000; i++) {
- if (i % 2 == 0) {
- System.out.println(i);
- } else {
- System.out.printf("-%d%n", i);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement