|
|
back to boardWA What's wrong with my code? Posted by P0Vlin 29 Nov 2022 20:09 #include <iostream> #include <algorithm> using namespace std; int main(){ int n, half, votes, q[101]; cin >> n; half = (n/2) + 1; for (int i=0; i < n;i++) cin >> q[i]; sort(q,q+n); for (int i =0;i<half;i++) votes += (q[i]/2) + 1; cout << votes; return 0; } |
|
|