fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int A,B,K;
  6. cin>>A>>B>>K;
  7. for(int i=A; i<=B; i++){
  8. if (i%K==0){
  9. cout<<i<<endl;
  10. }
  11. }
  12. return 0;
  13. }
Success #stdin #stdout 0s 5308KB
stdin
20 50 3
stdout
21
24
27
30
33
36
39
42
45
48