Untitled

Anonymous
plain_text
10/23/2022 1:40 PM
376 B
19
Indexable
#include <iostream>

using namespace std;
int main(){
    int a=0, b, c=0, d=0;
    cin >> b;
    while(a-b>1){
        b++;
        c += b;
        d += 1;
    }
    while(b-a>1){
        a++;
        c += a;
        d += 1;
    }
    cout << float(c)/float(d);
}
Editor is loading...