Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define F 31
- static int
- factorial (int n)
- {
- return (n < 2) ? 1 : n * factorial (n - 1);
- }
- int main()
- {
- int N, b;
- long int x;
- int a[F] = {0};
- scanf("%d", &N);
- b = N;
- for(int n = 0; b >= n; ++n){
- x = factorial(b)/(factorial(n)*factorial(b-n));
- a[n] = x;
- }
- for(int i = 0; i < F; i++){
- if (a[i]){
- printf("%d ", a[i]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement