Răspunsuri

2014-10-21T20:07:23+03:00
#include <iostream>
using namespace std;
int main ()
{ int n;
  int i;
  int p;
cin >> n;
for ( i = 1; i <= n; i++) p = p * i;
cout << p%10;
return 0;
}


2014-10-21T20:24:04+03:00
# include<iostream>
using namespace std;
int main()
{
    unsigned n,p=1,i;
    cin>>n;
    for(i=1;i<=n;i++)
        p=p*i;
    cout<<p%10;
    return 0;
}