Language: Java


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import java.util.Scanner;
??
public class Main {
??public static void main(String[] args) {
????Scanner sc = new Scanner(System.in);
????int n = sc.nextInt();
????int a;
????for (int i = 1; i <= n; i++) {
??????if (i % 3 == 0 || i % 10 == 3) {
????????System.out.print(" " + i);
??????} else if (i >= 30) {
????????a = i;
????????while (a >= 30) {
??????????a /= 10;
??????????if (a == 3 || a % 10 == 3) {
????????????System.out.print(" " + i);
????????????break;
??????????}
????????}
??????}
????}
????System.out.println();
??}
}

Compiler output:
Main.java:2: error: class, interface, enum, or record expected
4
^
Main.java:24: error: class, interface, enum, or record expected
??
^
Main.java:26: error: illegal start of type
??public static void main(String[] args) {
^
Main.java:27: error: illegal start of expression
????Scanner sc = new Scanner(System.in);
^
Main.java:27: error: illegal start of expression
????Scanner sc = new Scanner(System.in);
 ^
Main.java:27: error: illegal start of expression
????Scanner sc = new Scanner(System.in);
  ^
Main.java:27: error: illegal start of expression
????Scanner sc = new Scanner(System.in);
   ^
Main.java:27: error: : expected
????Scanner sc = new Scanner(System.in);
           ^
Main.java:27: error: : expected
????Scanner sc = new Scanner(System.in);
                                       ^
Main.java:28: error: illegal start of expression
????int n = sc.nextInt();
^
Main.java:28: error: illegal start of expression
????int n = sc.nextInt();
 ^
Main.java:28: error: illegal start of expression
????int n = sc.nextInt();
  ^
Main.java:28: error: illegal start of expression
????int n = sc.nextInt();
   ^
Main.java:28: error: '.class' expected
????int n = sc.nextInt();
        ^
Main.java:28: error: : expected
????int n = sc.nextInt();
                        ^
Main.java:29: error: illegal start of expression
????int a;
^
Main.java:29: error: illegal start of expression
????int a;
 ^
Main.java:29: error: illegal start of expression
????int a;
  ^
Main.java:29: error: illegal start of expression
????int a;
   ^
Main.java:29: error: '.class' expected
????int a;
        ^
Main.java:29: error: : expected
????int a;
         ^
Main.java:30: error: illegal start of expression
????for (int i = 1; i <= n; i++) {
^
Main.java:30: error: illegal start of expression
????for (int i = 1; i <= n; i++) {
 ^
Main.java:30: error: illegal start of expression
????for (int i = 1; i <= n; i++) {
  ^
Main.java:30: error: illegal start of expression
????for (int i = 1; i <= n; i++) {
   ^
Main.java:30: error: illegal start of expression
????for (int i = 1; i <= n; i++) {
    ^
Main.java:31: error: illegal start of expression
??????if (i % 3 == 0 || i % 10 == 3) {
^
Main.java:31: error: illegal start of expression
??????if (i % 3 == 0 || i % 10 == 3) {
 ^
Main.java:31: error: illegal start of expression
??????if (i % 3 == 0 || i % 10 == 3) {
  ^
Main.java:31: error: illegal start of expression
??????if (i % 3 == 0 || i % 10 == 3) {
   ^
Main.java:31: error: illegal start of expression
??????if (i % 3 == 0 || i % 10 == 3) {
    ^
Main.java:31: error: illegal start of expression
??????if (i % 3 == 0 || i % 10 == 3) {
     ^
Main.java:31: error: illegal start of expression
??????if (i % 3 == 0 || i % 10 == 3) {
      ^
Main.java:32: error: illegal start of expression
????????System.out.print(" " + i);
^
Main.java:32: error: illegal start of expression
????????System.out.print(" " + i);
 ^
Main.java:32: error: illegal start of expression
????????System.out.print(" " + i);
  ^
Main.java:32: error: illegal start of expression
????????System.out.print(" " + i);
   ^
Main.java:32: error: illegal start of expression
????????System.out.print(" " + i);
    ^
Main.java:32: error: illegal start of expression
????????System.out.print(" " + i);
     ^
Main.java:32: error: illegal start of expression
????????System.out.print(" " + i);
      ^
Main.java:32: error: illegal start of expression
????????System.out.print(" " + i);
       ^
Main.java:32: error: : expected
????????System.out.print(" " + i);
                                 ^
Main.java:33: error: illegal start of expression
??????} else if (i >= 30) {
^
Main.java:33: error: illegal start of expression
??????} else if (i >= 30) {
 ^
Main.java:33: error: illegal start of expression
??????} else if (i >= 30) {
  ^
Main.java:33: error: illegal start of expression
??????} else if (i >= 30) {
   ^
Main.java:33: error: illegal start of expression
??????} else if (i >= 30) {
    ^
Main.java:33: error: illegal start of expression
??????} else if (i >= 30) {
     ^
Main.java:33: error: illegal start of expression
??????} else if (i >= 30) {
      ^
Main.java:34: error: illegal start of expression
????????a = i;
^
Main.java:34: error: illegal start of expression
????????a = i;
 ^
Main.java:34: error: illegal start of expression
????????a = i;
  ^
Main.java:34: error: illegal start of expression
????????a = i;
   ^
Main.java:34: error: illegal start of expression
????????a = i;
    ^
Main.java:34: error: illegal start of expression
????????a = i;
     ^
Main.java:34: error: illegal start of expression
????????a = i;
      ^
Main.java:34: error: illegal start of expression
????????a = i;
       ^
Main.java:34: error: : expected
????????a = i;
             ^
Main.java:35: error: illegal start of expression
????????while (a >= 30) {
^
Main.java:35: error: illegal start of expression
????????while (a >= 30) {
 ^
Main.java:35: error: illegal start of expression
????????while (a >= 30) {
  ^
Main.java:35: error: illegal start of expression
????????while (a >= 30) {
   ^
Main.java:35: error: illegal start of expression
????????while (a >= 30) {
    ^
Main.java:35: error: illegal start of expression
????????while (a >= 30) {
     ^
Main.java:35: error: illegal start of expression
????????while (a >= 30) {
      ^
Main.java:35: error: illegal start of expression
????????while (a >= 30) {
       ^
Main.java:35: error: illegal start of expression
????????while (a >= 30) {
        ^
Main.java:36: error: illegal start of expression
??????????a /= 10;
^
Main.java:36: error: illegal start of expression
??????????a /= 10;
 ^
Main.java:36: error: illegal start of expression
??????????a /= 10;
  ^
Main.java:36: error: illegal start of expression
??????????a /= 10;
   ^
Main.java:36: error: illegal start of expression
??????????a /= 10;
    ^
Main.java:36: error: illegal start of expression
??????????a /= 10;
     ^
Main.java:36: error: illegal start of expression
??????????a /= 10;
      ^
Main.java:36: error: illegal start of expression
??????????a /= 10;
       ^
Main.java:36: error: illegal start of expression
??????????a /= 10;
        ^
Main.java:36: error: illegal start of expression
??????????a /= 10;
         ^
Main.java:36: error: : expected
??????????a /= 10;
                 ^
Main.java:37: error: illegal start of expression
??????????if (a == 3 || a % 10 == 3) {
^
Main.java:37: error: illegal start of expression
??????????if (a == 3 || a % 10 == 3) {
 ^
Main.java:37: error: illegal start of expression
??????????if (a == 3 || a % 10 == 3) {
  ^
Main.java:37: error: illegal start of expression
??????????if (a == 3 || a % 10 == 3) {
   ^
Main.java:37: error: illegal start of expression
??????????if (a == 3 || a % 10 == 3) {
    ^
Main.java:37: error: illegal start of expression
??????????if (a == 3 || a % 10 == 3) {
     ^
Main.java:37: error: illegal start of expression
??????????if (a == 3 || a % 10 == 3) {
      ^
Main.java:37: error: illegal start of expression
??????????if (a == 3 || a % 10 == 3) {
       ^
Main.java:37: error: illegal start of expression
??????????if (a == 3 || a % 10 == 3) {
        ^
Main.java:37: error: illegal start of expression
??????????if (a == 3 || a % 10 == 3) {
         ^
Main.java:37: error: illegal start of expression
??????????if (a == 3 || a % 10 == 3) {
          ^
Main.java:38: error: illegal start of expression
????????????System.out.print(" " + i);
^
Main.java:38: error: illegal start of expression
????????????System.out.print(" " + i);
 ^
Main.java:38: error: illegal start of expression
????????????System.out.print(" " + i);
  ^
Main.java:38: error: illegal start of expression
????????????System.out.print(" " + i);
   ^
Main.java:38: error: illegal start of expression
????????????System.out.print(" " + i);
    ^
Main.java:38: error: illegal start of expression
????????????System.out.print(" " + i);
     ^
Main.java:38: error: illegal start of expression
????????????System.out.print(" " + i);
      ^
Main.java:38: error: illegal start of expression
????????????System.out.print(" " + i);
       ^
Main.java:38: error: illegal start of expression
????????????System.out.print(" " + i);
        ^
Main.java:38: error: illegal start of expression
????????????System.out.print(" " + i);
         ^
Main.java:38: error: illegal start of expression
????????????System.out.print(" " + i);
          ^
100 errors
only showing the first 100 errors, of 155 total; use -Xmaxerrs if you would like to see more