title: Bool function in polynomial
body: <p>I'm trying to solve this task:
  "Write a bool sparse function (polynomial p) that takes polynomial p and returns true if 50% or more of the coefficients of polynomial p equals 0."</p>
  
  <p>I use header file from my university.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "polinomATP.h"     // header file
  using namespace std;
  
  bool sparse(polinom p);
  
  int main(){
  
      polinom p;
      int d;
      cout &lt;&lt; "Upisi najveci stupanj polinoma: "&lt;&lt;endl;     // enter poly degree
      cin&gt;&gt;d;
      for(int i=0; i&lt;=d; i++){
          cout&lt;&lt;"Upisi " &lt;&lt; i &lt;&lt;". koeficijent: "&lt;&lt;endl;    //enter coef.
          int k;
          cin&gt;&gt;k;
          Attach(&amp;p, i, k);
      }
  
      cout&lt;&lt;sparse(p);
  
      system("pause");
  }
  
  bool sparse(polinom p){
  
      int sum=0;
      for(int i=0; i&lt;=Degree(p); i++){
          if(Coef(p, i)==0){
              sum++;
          }
      }
      if(sum&gt;Degree(p)/2){
          cout&lt;&lt;"yes";
          return true;
      }
  }
  </code></pre>
  
  <p>I'm not really good with bool functions so I guess I'm doing something wrong there.
  Thank you!</p>