#include<stdio.h>
int main()
{
    int n,i,j;
//freopen("e://2.txt","r",stdin);
int a[4]={0},b[4]={2,3,5,7};
int str[6000];


for(i=1;i<5842;i++)
{
int t=0;
str[0]=1;
for(j=1;j<4;j++)
{
if(str[a[j]]*b[j]<str[a[t]]*b[t])
t=j;
}
str[i]=str[a[t]]*b[t];
for(j=0;j<4;j++)
{
if(str[i]==str[a[j]]*b[j])
a[j]++;
}
}
while(scanf("%d",&n)&&n)
{
       printf("The %d",n);
  if(n%10==1&&n%100!=11) printf("st ");
  else  if(n%10==2&&n%100!=12) printf("nd ");
    else if(n%10==3&&n%100!=13) printf("rd ");
            else printf("th ");
printf("humble number is %d.\n",str[n-1]);
}
return 0;
}

相关文章:

  • 2021-09-02
  • 2021-07-13
  • 2021-07-14
  • 2021-07-25
  • 2021-12-17
  • 2021-06-07
猜你喜欢
  • 2021-07-05
  • 2022-12-23
  • 2022-01-16
  • 2022-12-23
  • 2021-10-02
  • 2021-07-23
  • 2021-09-08
相关资源
相似解决方案