递归求1-100相加之和
public class Recursion {
public static int SumAll(int MAX_NUMBER){
if (MAX_NUMBER == 1){
return 1;
}else{
return MAX_NUMBER + SumAll(MAX_NUMBER-1);
}
}
public static void main(String[] args) {
System.out.println(SumAll(100));
}
}