蓝桥杯入门训练第二题画圆

来源:互联网 发布:投诉淘宝卖家电话多少 编辑:程序博客网 时间:2024/05/01 02:54

在myeclipse里的源码


package rumen;

import java.util.Scanner;
public class yuan {

public static void main(String[] args) {
int r;
double PI=3.14159265358979323;
Scanner sc=new Scanner(System.in);
r=sc.nextInt();
if(r>=1&&r<=10000){
System.out.printf("%.7f",PI*r*r);
}


}

}


虽然结果是正确的,但是直接这样放到蓝桥杯的网站上编译是错的。


原因有二:

1、不能导入包

2、类的名称得为Main




0 0