This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$a = array( array(1,2,3), array(4,5,6)); | |
for($i=0; $i < count($a[0]) ;$i++){ | |
$b[] = $a[0][$i] + $a[0][$i]; | |
$c[] = $a[1][$i] + $a[1][$i]; | |
if ($b[$i] > $a[$i]){ | |
echo $b[$i]; | |
} | |
if ($c[$i] > $a[$i]){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$a = array( | |
0 => array( | |
0=>10, | |
1=>10, | |
2=>10 | |
), | |
1 => array( | |
0=>43, | |
1=>78, | |
2=>78, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$a = array( | |
0 => array( | |
0=>21, | |
1=>44, | |
2=>35 | |
), | |
1 => array( | |
0=>43, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$a = array(array(10, 2, 12), array(15,19,7), array(1,5,16) ); | |
$min = $a[0][0]; | |
for($i = 0;$i < count($a);$i++){ | |
for ($j = 0; $j < count($a[$i]); $j++){ | |
if($a[$i][$j] < $min) | |
$min = $a[$i][$j]; | |
} | |
} | |
echo $min; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$a = array(array(10, 11, 2), array(15,19,7), array(1,30,20) ); | |
$buffer = array(); | |
$max = $a[0][0]; | |
for($i = 0;$i < count($a);$i++){ | |
for ($j = 0; $j < count($a[$i]); $j++){ | |
if($a[$i][$j] > $max) { | |
$max = $a[$i][$j]; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 2) Вывести Да ИЛИ НЕТ есть ли два одинаковых элемента В разных масивах | |
$stat = false; | |
$a = array(array(10,2322, 2), array(15,222,7), array(1,22,3)); | |
for($i = 0; $i < count($a); $i++){ | |
for($j = 0; $j < count($a[$i]); $j++){ | |
if(isset($a[$i+1][$j])){ | |
if($a[$i+1][$j] == $a[$i][$j]){ | |
$stat = true; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$array = array( | |
rand(1,100), | |
rand(1,100), | |
rand(1,100), | |
rand(1,100), | |
rand(1,100), | |
rand(1,100), | |
rand(1,100), | |
rand(1,100), | |
rand(1,100), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for($i = 0; $i < count($arraaa);$i++){ | |
$buffer = 0; | |
if(isset($arraaa [$i+1])){ | |
if($arraaa[$i] > $arraaa[$i+1]) { | |
$buffer = $arraaa[$i+1]; | |
$arraaa[$i+1] = $arraaa[$i]; | |
$arraaa[$i] = $buffer; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$arraaa = array(5,2,3,1); | |
for($i = 0; $i < count($arraaa);$i++){ | |
$buffer = 0; | |
if(isset($arraaa [$i+1])){ | |
if($arraaa[$i] > $arraaa[$i+1]) { | |
$buffer = $arraaa[$i+1]; | |
$arraaa[$i+1] = $arraaa[$i]; | |
$arraaa[$i] = $buffer; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$arraaa = array( | |
rand(1,100), | |
rand(1,100), | |
rand(1,100), | |
rand(1,100), | |
rand(1,100), | |
rand(1,100), | |
rand(1,100), | |
rand(1,100), |
OlderNewer