public class Digui {
public static void main(String[] args) {
int sum=getsum(100);
System.out.println(“sum=”+sum);
}
private static int getsum(int i) {
if(i==1){
return 1;
}
int temp=getsum(i-1);
return temp+i;
}
}
public class Digui {
public static void main(String[] args) {
int sum=getsum(100);
System.out.println(“sum=”+sum);
}
private static int getsum(int i) {
if(i==1){
return 1;
}
int temp=getsum(i-1);
return temp+i;
}
}