YAIMH1993的笔记
如果奇迹木有出现,就去创造一个
posts - 29,comments - 0,trackbacks - 0
好吧,我承认我真的没有其他办法了,代码太长,C++博客可能都爆栈了,所以省略了一些内容。。。。。。
如果有好的方法希望有大神指教
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace
std;
int
a[5843] = {0,1,2,3,4,5,6,7,8,9,10,12,14,15,16,18,20,21,24,25,27,。。。。。。,1990656000,1991485440,1992903750,1993359375,2000000000};
int
main() {
    int
n;
    while
(~scanf("%d",&n) && n) {
        printf("The %d",n);
        if
(n % 100 >= 11 && n % 100 <= 13) printf("th "); else if(n % 10 == 1) printf("st ");
        else if
(n % 10 == 2) printf("nd ");
        else if
(n % 10 == 3) printf("rd ");
        else
printf("th ");
        printf("humble number is %d.\n",a[n]);
    }

    return
0;
}

posted on 2012-10-22 11:24 YouAreInMyHeart 阅读(103) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理