Sephy Posted April 23, 2008 Report Share Posted April 23, 2008 (edited) tatad mans ieraxts gluko jo ierakstas tikai pedejais ieraxts kods te for ($i = 0; $i <= 31; $i++) { $n=$i+1; if ($i==0 or $i==1 or $i==3 or $i==7 or $i==15 or $i==31){continue;} if ($binarais[$i]==1) {echo "<br> binarais nummur $n ir vienads ar viens!!"; $k=$k+1; $vienumasivs= array($k=>$n); echo " tagad $k elements no masiva vienumasivs ir $vienumasivs[$k]";} } man ir baigi lielas aizdomas ka problema ir sheit: $vienumasivs= array($k=>$n); Edited April 23, 2008 by Sephy Link to comment Share on other sites More sharing options...
Vebers Posted April 23, 2008 Report Share Posted April 23, 2008 $vienumasivs[] = array($k=>$n); Link to comment Share on other sites More sharing options...
Sephy Posted April 23, 2008 Author Report Share Posted April 23, 2008 (edited) Notice: Undefined offset: 1 kas tas par erroru? edit: errora nav radas ka visi ieraksti vienadi ar array!?! <?php for ($i = 0; $i <= 31; $i++) { $n=$i+1; if ($i==0 or $i==1 or $i==3 or $i==7 or $i==15 or $i==31){continue;} if ($binarais[$i]==1) {echo "<br> binarais nummur $n ir vienads ar viens!!"; $k=$k+1; $vienumasivs[$k]= array($k=>$n); echo " tagad $k elements no masiva vienumasivs ir $vienumasivs[$k]";} } ?> Edited April 23, 2008 by Sephy Link to comment Share on other sites More sharing options...
andrisp Posted April 23, 2008 Report Share Posted April 23, 2008 droši vien $binarais[$i] vienā momentā neeksistē. Link to comment Share on other sites More sharing options...
Sephy Posted April 23, 2008 Author Report Share Posted April 23, 2008 (edited) to es tulir notesteshu edit: vislaik existee $binarais[i$]!! Edited April 23, 2008 by Sephy Link to comment Share on other sites More sharing options...
Sephy Posted April 23, 2008 Author Report Share Posted April 23, 2008 (edited) masivaa vispar neko nevar ieraxtit, taa $n vietaa var likt ko grib tapar nekas iekshaa neraxtaaas!!! $vienumasivs[$k]= array($k=>$n); edit: piemeram es uzraxtu $vienumasivs[$k]= array(1=>2); bet kad izvada $vienumasivs[$k]=1 tad rezultats protams array. man ir aizdomas ka shis normali nejaul $vienumasivs[$k] mainit.... Edited April 23, 2008 by Sephy Link to comment Share on other sites More sharing options...
Sephy Posted April 23, 2008 Author Report Share Posted April 23, 2008 (edited) rofl pats atrisinaju xD. viss izvadaas kaa nakas un vertibas ar ieraxtaas. tagad pasakiet kur bij mana kluda oO <?php for ($i = 0; $i <= 31; $i++) { $n=$i+1; if ($i==0 or $i==1 or $i==3 or $i==7 or $i==15 or $i==31){continue;} if ($binarais[$i]==1) {echo "<br> binarais nummur $n ir vienads ar viens!!"; $k=$k+1; $vienumasivs[$k]= array($k=>$n); if ($vienumasivs[$k]=$n) echo " tagad $k elements no masiva vienumasivs ir $vienumasivs[$k]"; else echo "some kinda stupid error";} } ?> EDIT:lol tiesham stradaa tagad arii visas citaas vietaas normali ieraxtijies Edited April 23, 2008 by Sephy Link to comment Share on other sites More sharing options...
marrtins Posted April 23, 2008 Report Share Posted April 23, 2008 Kāds ta uzdevums? Aizdoma, ka to var daudz vienkāršāk pierakstīt. Link to comment Share on other sites More sharing options...
Recommended Posts