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 |
不可能不对呀?WA 有高手吗#include<stdio.h> #include<stdlib.h> long int tpeak(int p,int e,int i,int d0) { p=p%23; e=e%28; i=i%33; long int d=d0; d++; while(((d-p)%23!=0 || (d-e)%28!=0 || (d-i)%33!=0) && d-d0<21252 ) { d++; } return d-d0; } int main() { int p[100],e[100],l[100],d[100]; int sum,i=0; scanf("%d %d %d %d",&p[i],&e[i],&l[i],&d[i]); while(p[i]!=-1) { i++; scanf("%d %d %d %d",&p[i],&e[i],&l[i],&d[i]); } sum=i; for(i=0;i<sum;i++) printf("Case %d: the next triple peak occurs in %ld days.\n",i+1,tpeak(p[i],e[i],l[i],d[i])); return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator