Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- typedef struct nrMare {
- int x[1000];
- int len = 0;
- } nrMare;
- int n;
- nrMare N;
- int inmultire (int n) {
- int t = 0, c;
- for (int i = 0; i < N.len; i++) {
- c = N.x[i] * n + t;
- N.x[i] = c % 10;
- t = c / 10;
- }
- while (t) {
- N.x[N.len++] = t % 10;
- t /= 10;
- }
- }
- int main() {
- scanf("%d", &n);
- N.x[0] = 1; N.len = 1;
- for (int i = 3; i <= n-1; i++) {
- inmultire(i);
- }
- for (int i = N.len - 1; i >= 0; i--) {
- printf("%d", N.x[i]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment