Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- long long n, a, k = 1, c;
- long long fuck (long long b) {
- for (int i = 1; i <= b; i ++) {
- k *= i;
- while (k) {
- if (k % 10 == 0) k /= 10; else
- break;
- }
- k %= 100000;
- }
- return k % 1000;
- }
- int main()
- {
- cin >> n;
- a = fuck(n);
- if (a >= 100) {cout << a; return 0;}
- if (a >= 10 && a < 100) {cout << 0 << a; return 0;}
- if (a < 10) cout << 0 << 0 << a;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement