|
|
back to threadReply to message- Messages should be written in English and correspond to the matter of the website.
- Messages should not contain offences and obscene words.
- Messages should not contain correct solutions.
Re: Who give me some tests? Posted by chensqi 21 Dec 2008 08:19 my programe can pass all your tests#,but i WA at ural's test#1,why...? does someone can help me? #include <stdio.h> main() { int i,j,k;
scanf("%lf%lf%lf%lf",&ch[1],&ch[2],&ch[3],&ch[4]); for(i=1;i<=4;i++) { time1[i]=(int)ch[i]; time2[i]=ch[i]-time1[i]; if((i==2 || i==4) && time1[i]<time1[i-1]) time1[i]+=24; } hour=time1[3]-time1[4]+time1[2]-time1[1]; mini=time2[3]-time2[4]+time2[2]-time2[1]; hour=abs(hour+mini*5.0/3.0); hour/=2; if(hour>5) hour=5; printf("%.0lf",hour); }
|
|
|