| ||||||||||
| 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 | |||||||||
Re:把scanner改为原来的输入方法试试看,如果还不行,那就是算法问题了,而不是java的问题In Reply To:把scanner改为原来的输入方法试试看,如果还不行,那就是算法问题了,而不是java的问题 Posted by:hawk at 2004-12-19 22:56:19 算法应该没有错啊
我刚刚改成了C的,就accept了。完全一样啊
#include <stdio.h>
int main(void){
int p, e, i, d;
int c=1;
int triple = 0;
scanf("%d%d%d%d", &p, &e, &i, &d);
while(p!=-1){
triple = (p*5544+e*14421+i*1288)%21252;
triple-=d;
if(triple <= 0)
triple+=21252;
printf("Case %d: the next triple peak occurs in %d days.\n", c++, triple);
scanf("%d%d%d%d", &p, &e, &i, &d);
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator