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"iostream.h" int k; void f(int p,int e,int i,int d) { for(int j=d+1;j<21252;j++) {if(float(j-p)/23==(j-p)/23&&float(j-e)/28==(j-e)/28&&float(j-i)/33==(j-i)/33) break;} cout<<"Case "<<k<<": "<<"the next triple peak occurs in "<<j-d<<" days."<<endl; } void main() { int p,e,i,d; for(k=1;;k++) { cin>>p>>e>>i>>d; if(p==-1||e==-1||i==-1||d==-1) break; f(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