#include <iostream>
#include <cmath>
#include <string>
using namespace std;
int main ( ) {
int age;
int ageTotal = 0 ;
int geometric_mean= 1 ;
int numberOfpeopleEntered = 0 ;
cout << "Enter first persons age or -1 to quit " << endl;
cin >> age;
while ( age ! = - 1 ) {
ageTotal = ageTotal + age;
numberOfpeopleEntered++ ;
cout << "Enter next persons age or -1 to quit " << endl;
cin >> age;
}
cout << "Number of people entered: " << numberOfpeopleEntered<< endl;
cout << "Average age:" << ageTotal/ numberOfpeopleEntered<< endl;
cout << "Geometric mean: " << pow ( geometric_mean,.5 ) << endl;
return 0 ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CiNpbmNsdWRlIDxzdHJpbmc+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4gKCkgewogICAgaW50IGFnZTsKICAgIGludCBhZ2VUb3RhbCA9IDA7CiAgICBpbnQgZ2VvbWV0cmljX21lYW49MTsKICAgIAogICAgaW50IG51bWJlck9mcGVvcGxlRW50ZXJlZCA9IDA7CiAgICAKICAgIGNvdXQgPDwgIkVudGVyIGZpcnN0IHBlcnNvbnMgYWdlIG9yIC0xIHRvIHF1aXQgIjw8ZW5kbDsKICAgIGNpbj4+YWdlOwogICAgCiAgICB3aGlsZSAoYWdlICE9IC0xKXsKICAgICAgICBhZ2VUb3RhbCA9IGFnZVRvdGFsICsgYWdlOwogICAgICAgIG51bWJlck9mcGVvcGxlRW50ZXJlZCsrOwogICAgICAgCiAgICAgICAgY291dDw8IkVudGVyIG5leHQgcGVyc29ucyBhZ2Ugb3IgLTEgdG8gcXVpdCAiPDxlbmRsOwogICAgICAgIGNpbj4+YWdlOyAgIAogICAgfQogICAgY291dDw8Ik51bWJlciBvZiBwZW9wbGUgZW50ZXJlZDogIjw8bnVtYmVyT2ZwZW9wbGVFbnRlcmVkPDxlbmRsOwogICAgY291dDw8IkF2ZXJhZ2UgYWdlOiI8PGFnZVRvdGFsLyBudW1iZXJPZnBlb3BsZUVudGVyZWQ8PGVuZGw7CiAgICBjb3V0PDwiR2VvbWV0cmljIG1lYW46ICI8PHBvdyhnZW9tZXRyaWNfbWVhbiwuNSk8PGVuZGw7CiByZXR1cm4gMDsKfQ==