life,the universe and everything

public class work
public static void main(String args[])throws IOException
BufferedReader br=new BufferedReader(new InputStremReader(;
int n;

some one plese point out the mistakes i have made and explain them please.

Spelling mistake. Write InputStreamReader instead of InputStremReader.

These are the errors:

  1. You can not declare the class public. Either remove the public or change the class name to Main.
    Either class work or public class Main.

The reason is that Codechef tests the code by putting the code in a file named

In Java, the name of the file should be the same as the public class.

So if the class is public, it has to be named as Main.

The second solution is don’t use a public class. In this case you can use any class name.

2. You have spelled InputStreamReader wrongly.

Here is the corrected solution link:

1 Like