Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Tính T(n) = 1 * 2 * 3 * ... * n
- // khai bao thu vien
- #include<stdio.h>
- #include<conio.h>
- void main()
- {
- // khai bao bien
- int n;
- // nhap du lieu
- scanf("%d",&n);
- long s=1;
- if(n==0||n<0)
- printf("0");
- else
- {
- for(int i=1;i<=n;i++)
- {
- s=s*i;
- }
- printf("%ld",s);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement