| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
大神们,谁能帮忙看一下我的代码错在哪里啊#include<stdio.h>
int main(void)
{
int n,i,a[5842],count=1;
a[0]=1;
scanf("%d",&n);
for(i=1;i<=2000000000;i++,count++)
if((i%2==0)||(i%3==0)||(i%5==0)||(i%7==0))
a[count]=i;
while(n!=0)
{
printf("The %d",n);
if(n % 10 == 1){
if(n % 100 == 11)
printf("th");
else
printf("st");
}
else if(n % 10 == 2){
if(n % 100 == 12)
printf("th");
else
printf("nd");
}
else if(n % 10 == 3){
if(n % 100 == 13)
printf("th");
else
printf("rd");
}
else
printf("th");
printf(" humble number is %d.\n",a[n]);
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator