返回目录
代码:
#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(); } }