java笔记-1

发布于 2014-09-22

public class sum { int sum = 0; int fum = 1; int n; public sum(int m) { n = m; } public void Countsum() { //求和 for(int i = 1;i <= n; ++ i) { sum += i; } } public void Countfum() {//求阶乘 for(int i = 1;i <= n;++i) { fum *= i; } } public static void main(String []args) { sum s=new ...