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

肿么了?求帮助,wa

Posted by 912106840442 at 2013-03-29 19:30:59 on Problem 1006
#include<iostream>
using namespace std;
int main(){
	int p,e,i,d,j=1,k=1,m=0,n=0,a[1000]={0},x=0;

	cin>>p>>e>>i>>d;
	while(p!=-1&&e!=-1&&i!=-1&&d!=-1){
	p=p%23;
	e=e%28;
	i=i%33;
    n=e+1;
	while(n%28!=e){
		n=23*j+p;
		++j;
	}
	m=n;
	while(m%33!=i){
		m=23*28*k+n;
		++k;
	}
    a[x]=m-d;
	
	++x;
	j=1;
	k=1;
	cin>>p>>e>>i>>d;
	}
     
	for(int h=0;h<x;++h){
        a[h]=(a[h]<=21252?a[h]:a[h]-21252);
		cout<<"Case"<<' '<<h+1<<':'<<' '<<"the next triple peak occurs in"<<' '<<a[h]<<' '<<"days."<<endl;
	}
	return 0;
}


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