I threw these in just to show that it works. Try it yourself!
It didn't like the "public" in my class.
import java.util.Scanner;
public class Telja {
public static void main(String[] args) {
int n;
Scanner myScanner = new Scanner(System.in);
n = myScanner.nextInt();
for(int i = 1 ; i <= n; ++i) {
System.out.printf("%d\n",i);
}
}
}