Advertisement
kalin729

yovkata 2

Jun 16th, 2018
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5. int n,k, pr=1;
  6. cout << "n: ";
  7. cin >> n;
  8. cout << "k: ";
  9. cin >> k;
  10.  
  11. for(int i = 0; i<n; i++){
  12.     if(i%k==0 && i > 0){
  13.         pr *= i;
  14.     }
  15. }
  16.  
  17. cout << pr;
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement