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

运行没问题,提交怎么就是WRONG ANSWER?高人看下!

Posted by Avery at 2009-07-22 16:28:38 on Problem 1247
#include "stdio.h"
main()
{ int N,i,sum,a[30],j,k;
  float M; 
do
{scanf("%d",&N);
   for(i=0,sum=0;i<N;i++)
	 {
	  scanf("%d",&a[i]);
      sum=sum+a[i];
	 }
	  for(j=0,k=0,M=0;j<N;j++)
	  {
		M=M+a[j];
		if(M==(sum/2.0))
		{
		  printf("Sam stops at position %d and Ella stops at position %d.\n",j+1,j+2);
		  break;
		}
        else
		 k++;
	    if(k==N-2)
	     printf("No equal partitioning.\n");
	  }
} 
while(N!=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