长沙到凤凰高铁多少钱:Java 会的人来帮个忙,用JAVA求,分别求n!和半径为3的圆的周长和面积

来源:百度文库 编辑:神马品牌网 时间:2024/05/06 17:54:55
用JAVA求,分别求n!和半径为3的圆的周长和面积

写出JAVA代码 最好是能运行的 没错误的~~ 谢谢了先

class One {
public static void main (String args[]) {
int n;
int j=1;
for (int i=1; i<n; i++){
j*=i;
}
System.out.println ("n!=" + j);
}
}

class Two {
public static void main (String args[]) {
double c, s;
double r = 3;
c = 2*Math.PI*r;
s = r*r*Math.PI;
System.out.println ("c=" + c);
System.out.println ("s=" + s);
}
}

你娃娃凶.