|
|
вернуться в форумwhy is wrong #5 #include<iostream> #include<vector> using namespace std; int main() { int k; cin>>k; vector<int> p; for(int i=0,a=0;i<k;i++) {cin>>a; p.push_back (a); } for(int temp=0,j=0;j<k-1;j++) { if(p[j]>p[j+1]) { temp=p[j]; p[j]=p[j+1]; p[j+1]=temp; } }
int out=0; for(int b=0;b<=k/2;b++) out=out+p[b]/2+1; cout<<out<<"\n"; return 0; } |
|
|