import java.util.Scanner;
public class Main {
public static void main(String[] args){
double pai = 3.14,Round,ans = 0;;
Scanner s = new Scanner(System.in);
int h , r;
int elephant = 20000;
h = s.nextInt();
r = s.nextInt();
Round = var(h,r,elephant,pai,0,0);
System.out.println(Round);
}
static double var(int h,int r,double e,double pai,double ans,int ansxs){
if(ans >= e){
return ansxs;
}else {
ans += r * r * pai * h;
if (ans < e) {
var(h, r, e, pai, ans, ansxs + 1);
}
}
}
}
我以前是学c++的,为什么c++和java不一样?