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 = a; i <= b; i+=c)
  11. {
  12. if (i % c == 0)
  13. {
  14. k++;
  15. }
  16. }
  17. cout << k;
  18. return 0;
  19. }
Success #stdin #stdout 0s 4568KB
stdin
1850
1900
50
stdout
2