C++로 억셉 받은 소스랑 (1, 1) (1, 2) ... (1, 1000), ... (1000, 1000)까지 제 컴에서 다 돌려봣는데 답이 다 같은데 왜 여기선 WA가 뜨죠??? 자바 컴파일러 버전이 달라서 그런걸까요?
import java.util.Scanner;
import java.math.*;
class Solution {
public static void main(String args[]) throws Exception {
Scanner sc = new Scanner(System.in);
BigDecimal R, L, A, V;
BigDecimal pi = new BigDecimal(3.14159);
R = new BigDecimal(sc.nextDouble());
L = new BigDecimal(sc.nextDouble());
A = new BigDecimal(R.doubleValue());
A = A.multiply(R);
A = A.multiply(pi);
V = new BigDecimal(A.doubleValue());
V = V.multiply(L);
double ten = (double)(9.999999999999);
V = new BigDecimal(Math.floor(V.doubleValue()*ten));
A = new BigDecimal(Math.floor(A.doubleValue()*ten));
BigInteger AA = A.toBigInteger();
BigInteger VV = V.toBigInteger();
long A1 = A.longValue();
long V1 = V.longValue();
System.out.println(A1/10 + "." + A1%10);
System.out.println(V1/10 + "." + V1%10);
}
}