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 |
why is my answer wrong???#include <iostream> #include <cstdio> using namespace std; #define N 10 int main() { int t,i=0,s=0,n; int x; int a[N]; cin>>n; while(s<n){ cin>>x; for(i=0;i<N;i++){ cin>>a[i]; for(int j=i+1;j<N;j++){ if(a[i]>a[j]){ t=a[i]; a[i]=a[j]; a[j]=t; } } } s++; cout<<x<<" "<<a[N-3]<<endl; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator