SHARE
TWEET

krusz

a guest Oct 21st, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $wiersz = file("wyniki.txt");
  3. $sumahex=0;
  4. $suma_a=0;
  5. for($i=0;$i<count($wiersz);$i++){
  6. if(is_numeric($wiersz[$i][0])){//sprawdzenie czy jest numerek na początku
  7. $sumahex +=explode(chr(9),$wiersz[$i])[2];
  8. $suma_a += explode(chr(9),$wiersz[$i])[3];
  9. }
  10. }
  11. $sumahex /=41;
  12. $suma_a /=41;
  13.  
  14. echo "<p>średnia hex wynosi: $sumahex<br>";
  15. echo "średnia a, wynosi $suma_a</p>";
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top