Advertisement
jonator

crit2 vBar

Dec 6th, 2013
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pair<bool, string> Esquema::i_buscarAreaTematica2 (Arbre<string> &a, Revista& r) {
  2.     pair<bool, string> p;
  3.     if (a.es_buit()) {
  4.       p.first = false;
  5.     }
  6.     else {
  7.       Arbre<string> a1, a2;
  8.       a.fills(a1, a2);
  9.       pair<bool, string> p1, p2;
  10.       p1 = i_buscarAreaTematica2 (a1, r);
  11.       p2 = i_buscarAreaTematica2 (a2, r);
  12.       if(a1.es_buit() and a2.es_buit()) {
  13.     if (r.esPC((a.arrel()))) {
  14.       p.first = true;
  15.       p.second = a.arrel();
  16.     }
  17.       }
  18.       else if (p1.first and not p2.first) {
  19.     p.first = true;
  20.     p.second = p1.second;
  21.       }
  22.       else if (not p1.first and p2.first) {
  23.     p.first = true;
  24.     p.second = p2.second;
  25.       }
  26.       else if (p1.first and p2.first) {
  27.     p.first = true;
  28.     p.second = a.arrel();
  29.       }
  30.       else
  31.     p.first = false;
  32.     }
  33.     return p;
  34.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement