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

为何总是runtime error

Posted by skt at 2012-08-20 01:15:27 on Problem 3507
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
	int a[6]={0};
	int sum,max,min,i;
	while(scanf("%d %d %d %d %d %d",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5])){
		if(a[0]==0&&a[1]==0&&a[2]==0&&a[3]==0&&a[4]==0&&a[5]==0)
			break;
		sum=0;
		max=-99999999,min=99999999;
		for(i=0;i<6;i++){
			sum+=a[i];
			if(max<a[i])
				max=a[i];
			if(min>a[i])
				min=a[i];
		}
		printf("%g\n",(sum-max-min)/4.0);
	}
}
交了多次总是runtime error

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