import java.util.Scanner;
public class Houseboat {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
for(int j = 1;j<=sc.nextInt();j++){
Float x = sc.nextFloat();
Float y = sc.nextFloat();
int e = (int) ((int)(x*x+y*y)*Math.PI/2/50+1);
System.out.println("Property "+j+": This property will begin eroding in year "+e+".");
}
System.out.println("END OF OUTPUT.");
}
}
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int col = in.nextInt();
for(int i = 0; i < col; i++){
float x = in.nextFloat();
float y = in.nextFloat();
float r = (float)(x*x+y*y);
float s = (float) (r*Math.PI);
int res = (int)s/100;
System.out.println("Property "+(i+1)+": This property will begin eroding in year "+(res+1)+".");
}
System.out.println("END OF OUTPUT.");
}
}
两段代码 第一段提示Runtime Error 第二段ac