Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:这样为什么是wrong answer??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); > } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator