int main() { int n,m; int result=0; scanf("%d %d",&n,&m); result=fun(n,m); printf("%d",result); } int fun(int n,int m){ int count=0; if(m==n){ count=n; }else{ count=m+fun(n,m-1); } return count; }
int main() { int n,m; int result=0; scanf("%d %d",&n,&m); result=fun(n,m); printf("%d",result); } int fun(int n,int m){ int count=0; if(m==n){ count=n; }else{ count=m+fun(n,m-1); } return count; }