Advertisement
catalyn

prob 1 pbinfo

Nov 6th, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int fact(int n)
  6. {
  7. int i,p=1;
  8. for(i=1;i<=n;i++)
  9. p=p*i;
  10. return p;
  11. }
  12. int main()
  13. {
  14. int n;
  15. cin>>n;
  16. cout<<fact(n);
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement