Advertisement
jonator

crit 1 no va

Dec 6th, 2013
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.06 KB | None | 0 0
  1. bool Esquema::i_buscarAreaTematica1 (Arbre<string> &a, Revista& r, list<string>& l, string& n, int& count) {
  2.     bool p;
  3.     if (a.es_buit()) {
  4.       p = false;
  5.     }
  6.     else if (r.esPC(a.arrel())) {
  7.       ++count;
  8.      
  9.     }
  10.     else {
  11.       n = a.arrel();
  12.       Arbre<string> a1, a2;
  13.       a.fills(a1,a2);
  14.       bool p1, p2;
  15.       list<string> l1, l2;
  16.       string n1,n2;
  17.       int count1 =0, count2 = 0;
  18.       p1 = i_buscarAreaTematica1 (a1, r, l1, n1, count1);
  19.       //cout << "l1: "<< l1.size() << endl;
  20.       p2 = i_buscarAreaTematica1 (a2, r, l2, n2, count2);
  21.      // cout << "l2: "<< l2.size() << endl;
  22.      
  23.       //Cas coincident els dos tenen totes les pcs
  24.       if ((l1.size() >= r.longitudPalabrasClave()) and (l1.size() > 1) and (l2.size() >= r.longitudPalabrasClave())) {
  25.     if (r.esPC(n1) or r.esPC(n2)) {
  26.       list<string>::iterator it;
  27.       it = l.begin();
  28.       l.insert(it, n);
  29.     }
  30.     else if (p1 and p2) {
  31.       list<string>::iterator it;
  32.       it = l.begin();
  33.       if (n1 < n2)
  34.         l.insert(it, n1);
  35.       else
  36.         l.insert(it, n2);
  37.     }
  38.       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement