public class Erathosten
{
    public static void main(String args[])
	{
	    // Create an array of boolean
	    boolean spieve[] = new boolean[100];
	    
	    // Initialize it to true
	    for (int i=0;i<spieve.length;++i)
	    {
		spieve[i] = true;
	    }

	    // Cross the multiples of i for i=2..100
	    for (int i=2;i<spieve.length;++i)
	    {
		for (int j=2*i;j<spieve.length;j += i)
		{
		    spieve[j] = false;
		}
	    }

	    // Prints the spieve
	    for (int i=0;i<spieve.length;++i)
	    {
		if (spieve[i])
		    System.out.print(i+"\t");
		else
		    System.out.print("\t");
		// Every ten numbers, print a linefeed
		if (i%10==9) System.out.println();
	    }
	}
}
