fork(1) download
  1.  
  2.  
  3. #include <stdio.h>
  4.  
  5. int main() {
  6. {
  7. int i,j,a;
  8. scanf("%d",&i);
  9. scanf("%d",&j);
  10.  
  11. if(i<j){
  12. for(i=i; i<=j; i++)
  13.  
  14. a=a+i;
  15.  
  16. printf("%d",a);
  17. }
  18.  
  19.  
  20.  
  21. else{
  22. for(j=j; j<=i; j++)
  23.  
  24. a=a+j;
  25.  
  26. printf("%d",a);
  27. }
  28.  
  29. }
  30. return 0;
  31. }
  32.  
Success #stdin #stdout 0.01s 5280KB
stdin
9
4
stdout
39