Mass and age distributions of stars in young open clusters