| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
郁闷,哪错了!!!#include<iostream>
#include<iomanip>
using namespace std;
float fact(int n)
{
float f=1;
for(int i=2;i<=n;i++)
f*=i;
return f;
}
int main()
{
int N,num;
while(cin>>N)
{
num=fact(N);int s=0;
while(s==0){
s=num%10;
num=num/10;
}
cout<<setw(5)<<N<<" -> "<<s<<endl;
}system("pause");return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator