Exception in thread "main" java.lang.NullPointerException at ANKTRAIN.main(Main.java:11)

I dont understand why this runtime error pops,whenever i try to run on codchef online IDE,whereas on other IDE it works perfectly fine with sample inputs and other inputs as well.

import java.io.*;
import java.util.*;
class ANKTRAIN
{
		
    public static void main(String args[]) throws java.io.IOException 
{
       
       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        long t =Long.parseLong(br.readLine().trim());

fed up with the same problem…

You may use java.util.Scanner for this.

Scanner sc = new Scanner(System.in);

long t = sc.nextLong();

1 Like

really codechef ass*hole

really codechef is ass*hole