23 lines
314 B
C++
23 lines
314 B
C++
|
#include <iostream>
|
||
|
#include <conio.h>
|
||
|
using namespace std;
|
||
|
|
||
|
int main() {
|
||
|
int n,i,k;
|
||
|
|
||
|
cout << "N = ";
|
||
|
cin >> n;
|
||
|
int *a = new int[n];
|
||
|
cout << "K = ";
|
||
|
cin >> k;
|
||
|
|
||
|
for(i=k*2; i<=n; i=i+k) {
|
||
|
cout << i << " ";
|
||
|
}
|
||
|
|
||
|
delete [] a;
|
||
|
|
||
|
system("pause");
|
||
|
getch();
|
||
|
return 0;
|
||
|
}
|