fork download
  1. #include<stdio.h>
  2. int sum(int m,int n)
  3. { if (m>=n) { return m; }
  4. return m + sum(m+1,n); }
  5.  
  6. int main()
  7. { int x,y;
  8. scanf("%d",&x);
  9. scanf("%d",&y);
  10. printf("%d",sum(x,y));
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 5288KB
stdin
1
5
stdout
15