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

错哪里错哪里错哪里???!!!

Posted by mervyn_diane at 2011-01-04 00:41:31 on Problem 2521
#include<iostream>

using namespace std;

int main()
{
	int N, M, P, C;
	cin >> N >> M >> P >> C;

	while( N + M + P + C != 0 )
	{
		if( P > M ) //The fake money given to the boss is lager. 
			cout << C + N << endl;
		else // or, subtract the money the customer gived to.
			cout << N + P - M << endl;
		cin >> N >> M >> P >> C;
	}
	
	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