|
|
back to boardWhat about 4-th test?Please help.Here is source: Posted by Search 31 Mar 2008 22:05 #include<iostream> #include<algorithm> using namespace std; int main() { int i,n,a[155],k=0; cin>>n; for(i=0;i<n;i++) cin>>a[i]; sort(a,a+n+1); for(i=0;i<n;i++) if(a[i]==a[i+3]) k++; cout<<k; return 0; } * Posted by Брэнд 1 Apr 2008 00:05 5 600 600 600 600 600 Re: * Posted by Search 1 Apr 2008 20:04 Thank you!!! Re: * Posted by LLIRIK 3 Apr 2008 22:59 5 600 600 600 600 600 what is the answer for this test? my programm writes 1 isn't it right?? It's obviously correct (-) Re: * Posted by tolia 7 Mar 2009 18:40 #include<iostream> #include<algorithm> using namespace std; int main() { int i,n,a[155],k=0; cin>>n; for(i=0;i<n;i++) cin>>a[i]; sort(a,a+n+1); for(i=0;i<n;i++) if(a[i]==a[i+3]) k++; cout<<k; return 0; } Re: * look at my test .... use your program 10 600 600 600 600 600 600 600 600 600 600 I think your answer is 7... But true answer is 2! Edited by author 26.05.2013 09:50 Re: * Sorry, but true answer is 1, on my opinion No subject Edited by author 04.12.2014 17:01 Edited by author 04.12.2014 17:02 |
|
|