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 |
你的数组开太小了 N<=10,000In Reply To:为什么总是Runtime error 求帮助 Posted by:0908060048 at 2012-10-20 10:51:19 > #include <stdio.h> > int main() > { > int a,b[1000],i,p,j,temp; > scanf("%d",&a); > for(i=0;i<a;i++) > scanf("%d",&b[i]); > for(p=0;p<a;p++) > { > for( j=a-1;j>p;j--) > if(b[j]<b[j-1]) > { > temp=b[j-1]; > b[j-1]=b[j]; > b[j]=temp; > } > > } > printf("%d\n",b[a/2]); > return 0; > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator