import java.util.Scanner; public class oj { public static void mian() { Scanner sc=new Scanner(System.in); int n,df,t,i=1; double f0,f1,dis,jt; double v,c=299792458; int dd=3,r=200000; n=sc.nextInt(); while(n>0) { df=sc.nextInt(); f0=sc.nextDouble(); f1=sc.nextDouble(); t=sc.nextInt(); dis=c*(t*1e-6)/2; v=c*(f1-f0)/(f1+f0); if(df==1) { System.out.print("Target"+i+":NO:ONE OF US"); } else { if(v<=0) { System.out.print("Target"+i+":NO:AWAY"); } else { if(dis<r) { if(dd>0) { System.out.print("Target"+i+":YES"); dd--; } else { System.out.print("Target"+i+":NO:NEXT TIME"); } } else { jt=(dis-r)/v; System.out.print("Target"+i+":NO:"+jt); } } } i++; n--; } } } /* Main.java:3: error: class oj is public, should be declared in a file named oj.java public class oj { ^ 1 error */ |
Double click to view unformatted code.