class Pays
{
private string m_Nom = string.Empty;
public string Nom
get { return m_Nom; }
set { m_Nom = value; }
}
private uint m_Population = 0;
public uint Population
get { return m_Population; }
set { m_Population = value; }
private uint m_Superficie = 0;
public uint Superficie
get { return m_Superficie; }
set { m_Superficie = value; }
public Pays()
public Pays(string Nom, uint Population, uint Superficie)
m_Nom = Nom;
m_Population = Population;
m_Superficie = Superficie;
public override string ToString()
return "Nom : " + Nom +
" - population : " + Population.ToString() +
" - superficie : " + Superficie.ToString();
static void DoJobOldWay()
Pays[] QuelquesPays = new Pays[]{
new Pays("France", 60000000, 550000),
new Pays("Turquie", 70000000, 750000),
new Pays("Chine", 1300000000, 9600000),
new Pays("USA", 300000000, 9000000),
new Pays("Maroc", 31000000, 450000),
new Pays("Suisse", 7500000, 40000) };
List<Pays> GrosPays = new List<Pays>();
foreach (Pays p in QuelquesPays)
if (p.Superficie > 1000000)
GrosPays.Add(p);
// Operations...
foreach (Pays p in GrosPays)
Console.WriteLine(p);