fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int m, n;
  6. printf("Nhap so nguyen m va n (m<n): ");
  7. scanf("%d %d", &m, &n);
  8.  
  9. int a = (n-m+1)*(m+n)/2;
  10. printf("%d", a);
  11. return 0;
  12.  
  13. }
Success #stdin #stdout 0s 5284KB
stdin
2 3
stdout
Nhap so nguyen m va n (m<n): 5