fork download
  1. //#include "stdafx.h"
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int a, b, c, k;
  8. cin >> a >> b >> c;
  9. k = 0;
  10. for (int i = 0; i >= b; i += c)
  11. {
  12. if ((i >= a) && (i <= b)) k+=1;
  13. }
  14. cout << k;
  15. return 0;
  16. }
Success #stdin #stdout 0s 4396KB
stdin
1850
1900
50
stdout
Standard output is empty