Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
532 B
0
Indexable
Never
#include <iostream>
#include <cmath>
#include <vector>
using namespace std;
int main() {
    // #2
    
    int n;
    float h,temp,f=0,b;
    cin >> n;
    float mas[100];
    for (int i = 0; i < n; i++) {
        cin >> temp;
        mas[i] = temp;
        f += temp;
    }
    if (n % 2 == 0) h = float(f / n);
    else if (n%2 == 1) h = mas[((n-1) / 2)-1];
    for (int i = 0; i < n; i++){
        if (i-h < 0) {
            cout << -(i - h) << ' ';
        }
        else cout << i - h << ' ';

    }
}