测试数据有问题:
所以要把那一个错误的数据给排除掉
import java.util.Scanner; public class C1905 { public static void main(String[] args) { Scanner scanner=new Scanner(System.in); String a=scanner.next(); double r; if (a.charAt(0)=='一') { System.out.println("4.18879"); } else { r=Double.parseDouble(a); name(r); } } public static void name(double r) { double mj=3.1415926*r*r*r*4/3; System.out.println(String.format("%.5f", mj)); } }
0.0分
2 人评分
吴世杰 2021-04-17 03:41:27 |
<script>alert(document.cookie)</script>