Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

怎么老是Time Limit Exceeded

Posted by ustc911 at 2011-08-22 15:33:33 on Problem 1003
#include<stdio.h>
int main()
{
int i=0,n=1,b[10];
float s=0.0,m=0.01,a=0.01,c[10];
while(a!=0)
{
scanf("%f",&a);
if(a>5.20) printf("input error\n");
else {c[i]=a;i++;}
}
while(m>0)
{
s=s+1/(n+1);
for(i=0;c[i]>0;i++)
{
if(c[i]<s) b[i]=n;
m=c[i];
}
n++;
}
b[i+1]=0;
for(i=0;b[i]>0;i++)
printf("%5dcard(s)",b[i]);
return 0;
}


Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator