#include
int main() {
int n;
do {
scanf("%d", &n);
switch(n % 10) {
case 1:
printf("%dst\n", n);
break;
case 2:
printf("%dnd\n", n);
break;
case 3:
printf("%drd\n", n);
break;
default:
if(n) printf("%dth\n", n);
break;
}
} while(n);
return 0;
}
你是山科信管学生吧