int sum(int x,int y){ int z; if(y=1) z=1; else z=sum(x-1,y-1)+y; return(z);}
main(){ int s,n,i; scanf("%d,%d",&n,&i); printf("%d",sum(int n,int i));
}递归 求 1+2+3+ ~ ~ ~ +100的和 if(y=1) z=1; 总是这一句有问题
int sum(int x,int y){ int z; if(y==1) z=1; else z=sum(x-1,y-1)+y; return(z);}
main(){ int s,n,i; scanf("%d,%d",&n,&i); printf("%d",sum(n,i));
} 这样吧 ? 刚刚自己在看了下