|
|
вернуться в форумWhat about 4-th test?Please help.Here is source: Послано Search 31 мар 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; } * Послано Брэнд 1 апр 2008 00:05 5 600 600 600 600 600 Re: * Послано Search 1 апр 2008 20:04 Thank you!!! Re: * Послано LLIRIK 3 апр 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: * Послано tolia 7 мар 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 |
|
|