Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

郁闷,哪错了!!!

Posted by zhuoyi at 2010-07-11 14:44:29
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator