求100内的数和

//1+2+3+...+n
static
int add(int n) { if(n == 1) { return 1; } else { return n + add(n-1); } }

 

posted on 2014-06-19 22:26  Lishenyin  阅读(147)  评论(0编辑  收藏  举报

导航