您的位置:首页 > 其它

The 8th Zhejiang Provincial Collegiate Programming Contest / A - Ordinal Numbers

2011-04-16 18:11 465 查看
返回目录

代码:

]#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
inline int Rint() {int x; scanf("%d", &x); return x;}
int x;
void solve()
{
int t = (x/10)%10;
if(t == 1)
{
printf("%dth/n", x);
}
else
{
t = x%10;
if(t == 1)
printf("%dst/n", x);
else if(t == 2)
printf("%dnd/n", x);
else if(t == 3)
printf("%drd/n", x);
else printf("%dth/n", x);
}
}
int main()
{
int t = Rint();
while(t--)
{
x = Rint();
solve();
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐