Advertisement
nguyenhappy92

Hãy tính tích các chữ số của số nguyên dương n

Oct 8th, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. // Hay tinh tich cac chu so cua so nguyen duong n
  2.  
  3. // Khai bao ham thu vien
  4. #include<stdio.h>
  5. #include<conio.h>
  6.  
  7. void main()
  8. {
  9. int n;
  10. scanf("%d",&n);
  11. long s=1;
  12. for(int i=1;i<=n;i++)
  13. {
  14. s=s*i;
  15. }
  16. printf("%ld",s);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement