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("Tong cac so trong [%d %d] la: %d/n", m, n, a);
  11. return 0;
  12. }
Success #stdin #stdout 0s 5292KB
stdin
Standard input is empty
stdout
Nhap so nguyen m va n (m<n): Tong cac so trong [917148320 32766] la: -216590511/n