fork(1) 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.  
  10. int h,m,sec;
  11. void getdata()throws IOException
  12. { /*Scanner in = new Scanner(System.in);`
  13.   h=in.nextInt();
  14.   m= in.nextInt();
  15.   s=in.nextInt();*/
  16.  
  17.  
  18. String s= br.readLine();
  19. String str[] = s.split(" ");
  20.  
  21. h=Integer.parseInt(str[0]);
  22. m=Integer.parseInt(str[1]);
  23. sec=Integer.parseInt(str[2]);
  24. }
  25. int calc_time(time t1,time t2)
  26. { return ((t2.h - t1.h)*3600 + (t2.m - t1.m)*60 + (t2.sec - t1.sec));
  27. }
  28. public static void main (String[] args) throws java.lang.Exception
  29. {
  30. // your code goes here
  31. time t = new time();
  32. t.getdata();
  33. time te = new time();
  34. te.getdata();
  35. time tt = new time();
  36. int val = tt.calc_time(t,te);
  37. if(val>=0&&val<=99) System.out.println("S");
  38. else if(val>99&&val<=199) System.out.println("C");
  39. else if(val>199 && val<=299) System.out.println("S");
  40. else if(val>299 && val<=399) System.out.println("C");
  41.  
  42. }
  43. }
Success #stdin #stdout 0.08s 381184KB
stdin
56 58 10
56 58 13
stdout
S