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:为什么会错误呢?求大神指教!

Posted by KAISHEN at 2020-03-31 12:20:17 on Problem 1006
In Reply To:为什么会错误呢?求大神指教! Posted by:KAISHEN at 2020-03-31 12:19:54
> #include<iostream>
> #include<cmath>
> #include<algorithm>
> #include<string>
> #include<vector>
> #include<map>
> #include<iomanip>
> using namespace std;
> int main()
> {
> 	int a, b, c, d;
> 	vector<int>count;
> 	int pos = 0;
> 	while (cin >> a >> b >> c >> d)
> 	{
> 		if (a == b && b == c && c == d && d == -1)
> 			break;
> 		for (; a > 23 + d; a -= 23);
> 		for (; (a - b) % 28 != 0 || (a - c) % 33 != 0 || a == 0;)
> 		{
> 			a += 23;
> 		}
> 		if (a - d > 21252)
> 			count.push_back((a - d) % 21252);
> 		else
> 			count.push_back(a - d);
> 		pos++;
> 	}
> 	for (int i = 0; i < pos; ++i)
> 		cout << "Case " << i + 1 << ": the next triple peak occurs in " << count[i] << " 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