fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int l,r,k;
  7. cin>>l>>r>>k;
  8. int count=0;
  9. for(int i=l;i<=r;i++)
  10. {
  11. if(i%k==0)
  12. {
  13. count=count+1;
  14. }
  15. }
  16. cout<<count;
  17. return 0;
  18. }
Success #stdin #stdout 0.01s 5420KB
stdin
1 10 1
stdout
10