im new, and trying to submit my first solution, to the PRIME1 problem. i keep getting a "compilation problem".
here is the solution i have submitted:
import java.util.Collections;
import java.util.LinkedList;
import java.util.Scanner;
public class Main
{
public static void main (String[]args)
{
Scanner input=new Scanner (System.in);
int f=input.nextInt();
int[]a=new int[f];
int[]b=new int[f];
for(int j=0; j {
int m=input.nextInt();
int n=input.nextInt();
a[j]=m;
b[j]=n;
}
for(int j=0; j Listlst=new List();
lst.insert(null, 2);
Nodepos=lst.getFirst();
for(int i=3; i while(pos.getNext()!=null&&i%pos.getInfo()!=0)
{
pos=pos.getNext();
}
if (pos.getNext()==null){
Nodepos1=new Node(i);
pos.setNext(pos1);
}
pos=lst.getFirst();
}
while(pos!=null){
if(pos.getInfo()>=a[j])
System.out.println(pos.getInfo());
pos=pos.getNext();
}
System.out.println();
}
}
}
and here is the errors page:
/sources/Main.java:20: cannot find symbol
symbol : class List
location: class Main
Listlst=new List();
^
/sources/Main.java:20: cannot find symbol
symbol : class List
location: class Main
Listlst=new List();
^
/sources/Main.java:22: cannot find symbol
symbol : class Node
location: class Main
Nodepos=lst.getFirst();
^
/sources/Main.java:29: cannot find symbol
symbol : class Node
location: class Main
Nodepos1=new Node(i);
^
/sources/Main.java:29: cannot find symbol
symbol : class Node
location: class Main
Nodepos1=new Node(i);
^
5 errors
the problem probably lies in the classes importation, but i can't figure it out.
can someone please help me?
thanks