Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Timus 1025
- #include <cmath>
- #include <iostream>
- using namespace std;
- int main()
- {
- double k, s, nn[101], sub, answ=0;
- cin >> k;
- s=ceil(k/2);
- for(int i=0;i<k;i++)
- {
- cin >> nn[i];
- }
- for(int i=0;i<k;i++)
- {
- for(int y=0;y<k-1;y++)
- {
- if(nn[y]>nn[y+1])
- {
- sub = nn[y];
- nn[y] = nn[y+1];
- nn[y+1] = sub;
- }
- }
- }
- for(int i=0;i<s;i++)
- {
- answ+=ceil(nn[i]/2);
- }
- cout << answ;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement