Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main(){
- int n,k, pr=1;
- cout << "n: ";
- cin >> n;
- cout << "k: ";
- cin >> k;
- for(int i = 0; i<n; i++){
- if(i%k==0 && i > 0){
- pr *= i;
- }
- }
- cout << pr;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement