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:hi that is the solution

Posted by stephtan at 2008-08-09 23:57:18 on Problem 2636
In Reply To:Re:hi that is the solution Posted by:stephtan at 2008-08-09 23:57:06
#include <stdio.h>
int main()
{
	int cases;
	scanf("%d",&cases);
	while(cases--)
	{		
		int data,result,i,n;
		scanf("%d",&n);
		for(result=i=0;i<n;i++) {scanf("%d",&data); result+=data;}
		printf("%d\n",result+1-n);
	}
	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