Advertisement
Josif_tepe

Untitled

May 21st, 2024
815
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int n;
  7.     cin >> n;
  8.  
  9.     int i = 1;
  10.     int proizvod = 1;
  11.     while(i <= n)
  12.     {
  13.         if(i % 5 == 0)
  14.         {
  15.             proizvod *= i;
  16.         }
  17.         i += 1;
  18.     }
  19.     cout << proizvod << endl;
  20.     return 0;
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement