Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Methode ToString() Theorique 2013
- By bouchnina Brahim
- 3 point et demi machi sahla ;)
- */
- // Premiere Solution
- public override string ToString(){
- Personne p;
- list<Personne> liste = new list<Personne>();
- string text=string.Empty;
- p=this.Pere;
- do{
- if(p==null) return text;
- liste.Add(p);
- p=p.Pere;
- }while(p!=null);
- for(int i=0;i<liste.Count;i++){
- text+=(liste[i].NomComplet()+"\n");
- }
- return text;
- }
Advertisement
Add Comment
Please, Sign In to add comment