|
|
вернуться в форумplease tell me test № 5 why the wrong answer? please tell me test № 5. sorry for bad english. Edited by author 09.11.2010 02:45 Re: please tell me test № 5 #include <iostream> #include <algorithm> using namespace std; int main() { int mass[160]={0}; int n,i,kolvo=0,xz=1; cin>>n; for (i = 0; i < n; i++) { cin>>mass[i]; } sort(&mass[0],&mass[n]); for (i = 1; i < n; i++) { if (mass[i]==mass[i-1]) { xz++; } if (mass[i]!=mass[i+1]) { if (xz/4>=1) { kolvo+=xz/4.0; xz=1; } } } cout<<kolvo; return 0; } Re: please tell me test № 5 You can use not only the wheels of the same size |
|
|