title: Text appearing more than once
body: <p>so I am trying to come up with a firefighting system for my science fair project and one of the main things that come with trying to do so is the coding.  it is still in the early stages but for the final product of what I have so far, the code is unnecessarily repeating itself, and I don't know how to stop it.  this is the code, so please, if you answer it, paste the fixed code and tell me what is wrong so I don't run into it later.  code:</p>
  
  <pre><code>#include &lt;fstream&gt;
  using namespace std;
  int main() {
     int ave = 0;
     int num;
     //begins ave and basic info being collected
     cout &lt;&lt; "how many sensors will there be: " &lt;&lt; endl;
     cin &gt;&gt; num;
  
     int sen[num];
     cout &lt;&lt; "enter the heat on the sensors in order: " &lt;&lt; endl;
     for( int i=0; i&lt;num; i++ ){
        cin &gt;&gt; sen[i];
        ave = ave + sen[i];
     }
  
     ave = ave / num;
     cout &lt;&lt; ave &lt;&lt; endl;
     //end of basic info/average
     bool sens[num];
     for( int i=0; i&lt;num; i++ ){
        if( sen[i] + 60 &gt; ave ){
           sens[i] = 1;
        }
     }
  
     for( int i=0; i&lt;num; i++ )
        if( sens[i] == 1 ){
           cout &lt;&lt; "there is a fire at sensor" &lt;&lt; sens[i] &lt;&lt; endl;
        }
     }
  }
  </code></pre>