Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. foreach($nahoda as $a)
  2. {
  3. if($a ==1)
  4. {
  5. $jedna++;
  6. }
  7. if($a ==2)
  8. {
  9. $dva++;
  10. }
  11. if($a ==3)
  12. {
  13. $tri++;
  14. }
  15. if($a ==4)
  16. {
  17. $ctyri++;
  18. }
  19. if($a ==5)
  20. {
  21. $pet++;
  22. }
  23. if($a ==6)
  24. {
  25. $sest++;
  26. }
  27. }
  28. echo "Jedniček je $jedna, dvoje je $dva, trojek je $tri, ctyrek je $ctyri, pětek je $pet a sestek je $sest";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement