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

AC了的人帮我帮帮!!

Posted by xhu_li at 2009-01-10 15:49:40 on Problem 3117
搞不懂哦!!为什么总是wa了,哇了5次了。。谢谢!!!

#include<iostream>
using namespace std;
int main()
{
	long T,N;
	while((cin>>T>>N)&&T!=0)
	{
		char str[15];
		long i,k;
		long sum=0,max;
		for(i=0;i<T;i++)
		{
			cin>>str;
			cin>>k;
			sum+=k;
		}
		max=T*N;
		if(N!=0)
			cout<<max-sum<<endl;
		else
			cout<<"0"<<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