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 bingshen at 2010-03-13 11:25:25 on Problem 1017
#include<stdio.h>
const int u[4]={0,5,3,1};
int main()
{
int a[7],m,k,t,sum,i,left1,left2;
while(1)	
	{
	for(i=1;i<7;i++)
		scanf("%d",&a[i]);
	if(a[1]+a[2]+a[3]+a[4]+a[5]+a[6]==0)
		break;
	sum=a[4]+a[5]+a[6];
	k=a[3]/4;
	if(k>0)
		sum+=k;
	if(a[3]%4)
		sum++;
	left1=a[4]*5+u[a[3]%4];
	if(a[2]>left1)
		{
		m=(a[2]-left1)/9;
		if(m>0)
			sum+=(m+1);
		else
			sum++;
		}
	left2=sum*36-a[6]*36-a[5]*25-a[4]*16-a[3]*9-a[2]*4;
	if(a[1]>left2)
		{
		t=(a[1]-left1)/36;
		if(t>0)
			sum+=(t+1);
		else
			sum++;
		}
	printf("%d\n",sum);
	}
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