/**
* 2015年4月24日下午8:48:22
* author season TODO 测试通过,望采纳
*
*/
public class SimpleCount {
/**
* addOneToTen TODO 计算1+2+3+..+10的和
* return int
*/
public static int addOneToTen(){
int sum =0;
for(int index =0; index<=10; index++)
sum += index;
return sum;
}
/**
* fiveOp TODO 计算5!
* return int
*/
public static int fiveOp(){
int num = 1;
for(int index =1 ; index<=5; index++)
num *= index;
return num;
}
public static void main(String[] args){
System.out.println("\nThis is 1+2+3+...+10= "+ addOneToTen());
System.out.println("\nThis is 5! = "+ fiveOp());
}
}