Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Hay tinh tich cac chu so le cua so nguyen duong n
- // Khai bao ham thu vien
- #include<stdio.h>
- #include<conio.h>
- void main()
- {
- int n;
- scanf("%d",&n);
- long s=1;
- if(n==0)
- {
- printf("0");
- }
- else
- {
- for(int i=1;i<=n;i++)
- {
- if(i%2!=0)
- {
- s=s*i;
- }
- }
- printf("%ld",s);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement