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

Re:为什么下面这段程序在自己的环境里没问题,叫了就wronganswer呢?

Posted by dart at 2007-10-07 01:01:02 on Problem 1006
In Reply To:为什么下面这段程序在自己的环境里没问题,叫了就wronganswer呢? Posted by:ljl08 at 2007-07-22 12:25:31
#include<iostream>
using namespace std;
int main()
{
	int p,e,i,d,m=0;
	cin>>p>>e>>i>>d;
	while(!(p==-1&&e==-1&&i==-1&&d==-1))
	{	 m++;
	     int n;
	  for( n=1;n<=924;n++)
	  { 
		if  (  ((p+23*n)-e )%28==0  &&  ((p+23*n)-i )%33==0)
		{  
		     if(p+23*n<21252)
             cout<<"Case "<<m<<": the next triple peak occurs in "<<p+23*n-d<< " days."<<endl;
			 else 
             cout<<"Case "<<m<<": the next triple peak occurs in 21252 days."<<endl;
			 break;

		}
				
	  }
	  cin>>p>>e>>i>>d; 
	}
	return 0;
}


这是我的程序在自己环境里面运算和我用同学答案提交的程序计算出来的结果都是一样的,但是一直是WA,把我也给郁闷的.....只要自己想清楚了就行..

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