A characterization of euclidean spaces