I need to do what the subject title says, the detail is that it is an array that has a maximum size of 10, so I don't know when they will enter a different size, that is, 10 is not mandatory, but if it is the maximum, I am new to the language.
Go to the end of the code:
<?php
function sevent(int $c){
if(($c/7)>17)
return true;
else
return false;
}
function sprimo(int $b){
$d=1; $p=0;
do{
if($b % $d == 0)
$p++;
$d++;
}while($d < $b+1);
if($p==2)
return true;
else
return false;
}
function lenner(string $a)
{
$sz = strlen($a);
$vector;
$cat;
$b;
$i;
$x;
for($i=0; $i<$sz; $i++)
$vector[$i]=ord($a[$i]);
for($i=0; $i<$sz; $i++){
$x=$vector[$i];
if(sprimo($x)){
$vector[$i]+=5;
$cat[$i]=1;
goto jump;
}
if(sevent($x)){
$vector[$i]-=7;
$cat[$i]=2;
goto jump;
}
else{
$vector[$i]+=9;
$cat[$i]=3;
}
jump:
}
for($i=0; $i<$sz; $i++)
$b[$i]=chr($vector[$i]);
$sub2 = $b[0] . $b[1] . $b[2] . $b[3] . $b[4] . $b[5] . $b[6] . $b[7] . $b[8] . $b[9] ;
return $sub2;
}
A million thanks