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

ac过的代码

Posted by zjut020 at 2009-02-25 17:30:10 on Problem 2247
while(cin>>n&&n)
    {
        
            if(n%10==1&&n%100!=11)
            s="st";
            else if(n%10==2&&n%100!=12)
            s="nd";
            else if(n%10==3&&n%100!=13)
            s="rd";
            else s="th";           
        
        cout<<"The "<<n<<s<<" humble number is "<<dp[n]<<"."<<endl;
    }

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