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:这样为什么是wrong answer??

Posted by gucun4848 at 2008-07-20 19:12:22 on Problem 2209
In Reply To:这样为什么是wrong answer?? Posted by:akheyun at 2008-03-22 12:43:15
> #include"stdio.h"
> void main()
> {
> 	int sons,n,a[100],i,sum,j,temp;
> 	sum=0;
> 	scanf("%d",&sons);
> 	scanf("%d",&n);
> 	for(i=0;i<sons;i++)
> 		scanf("%d",&a[i]);
> 	for(i=0;i<sons;i++)
> 		if(a[i]>=0)
> 		{	
> 			temp=a[i];
> 			for(j=1;j<n;j++)
> 				a[i]*=temp;
> 		}
> 	for(i=0;i<sons;i++)
> 		if(a[i]>=0)
> 			sum+=a[i];
> 	printf("%d\n",sum);
> }



我也WA~~~思想一样

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