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(); } }
相关文章推荐
- The 8th Zhejiang Provincial Collegiate Programming Contest / A - Ordinal Numbers
- The 8th Zhejiang Provincial Collegiate Programming Contest / M - Median
- The 8th Zhejiang Provincial Collegiate Programming Contest / M - Median
- The 8th Zhejiang Provincial Collegiate Programming Contest / D - String Successor
- The 8th Zhejiang Provincial Collegiate Programming Contest / D - String Successor
- The 8th Zhejiang Provincial Collegiate Programming Contest
- The 8th Zhejiang Provincial Collegiate Programming Contest / 解题报告 11.4.16
- The 8th Zhejiang Provincial Collegiate Programming Contest / 解题报告 11.4.16
- The 8th Zhejiang Provincial Collegiate Programming Contest / B - Conic Section
- The 8th Zhejiang Provincial Collegiate Programming Contest / B - Conic Section
- The 8th Zhejiang Provincial Collegiate Programming Contest->A - Ordinal Numbers
- The 8th Zhejiang Provincial Collegiate Programming Contest / F - Kagome Kagome
- The 8th Zhejiang Provincial Collegiate Programming Contest->B - Conic Section
- The 8th Zhejiang Provincial Collegiate Programming Contest / F - Kagome Kagome
- The 8th Zhejiang Provincial Collegiate Programming Contest-> Kagome Kagome
- The 8th Zhejiang Provincial Collegiate Programming Contest / L - Javabeans
- The 8th Zhejiang Provincial Collegiate Programming Contest / L - Javabeans
- The 8th Zhejiang Provincial Collegiate Programming Contest->M - Median
- The 13th Zhejiang Provincial Collegiate Programming Contest (杂谈)
- The 13th Zhejiang Provincial Collegiate Programming Contest - C