pragma solidity^0.4.0;
contract Group{
struct Person{
string name;
uint age;
}
Person[] person;
function addPerson(string _name,uint _age){
person.push(Person(_name,_age));
}
function getAverageAge() returns (uint){
uint total=0;
uint length=person.length;
for(uint i=0;i<length;i++){
total+=person[i].age;
}
uint ave=total/length;
return ave;
}
}