fork(6) download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. /* Name of the class has to be "Main" only if the class is public. */
  6.  
  7. class time
  8. {
  9. int h,m,sec;
  10. void getdata()throws IOException
  11. { /*Scanner in = new Scanner(System.in);`
  12.   h=in.nextInt();
  13.   m= in.nextInt();
  14.   s=in.nextInt();*/
  15.  
  16. String s= br.readLine();
  17. String str[] = s.split(" ");
  18.  
  19. h=Integer.parseInt(str[0]);
  20. m=Integer.parseInt(str[1]);
  21. sec=Integer.parseInt(str[2]);
  22. }
  23. int calc_time(time t1,time t2)
  24. { return ((t2.h - t1.h)*3600 + (t2.m - t1.m)*60 + (t2.sec - t1.sec));
  25. }
  26. public static void main (String[] args) throws java.lang.Exception
  27. {
  28. // your code goes here
  29. time t = new time();
  30. t.getdata();
  31. time te = new time();
  32. te.getdata();
  33. time tt = new time();
  34. int val = tt.calc_time(t,te);
  35. if(val>=0&&val<=99) System.out.println("S");
  36. else if(val>99&&val<=199) System.out.println("C");
  37. else if(val>199 && val<=299) System.out.println("S");
  38. else if(val>299 && val<=399) System.out.println("C");
  39.  
  40. }
  41. }
Runtime error #stdin #stdout #stderr 0.07s 380160KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Exception in thread "main" java.lang.NullPointerException
	at time.getdata(Main.java:18)
	at time.main(Main.java:31)