Jump to content
php.lv forumi

Mainiigs Mainiigais


Sliipeetais

Recommended Posts

Situaacija - tiek sanjemti bezgaliigi daudz mainiigie (m1, m2, m3, m4 u.t.t.), katrs mainiigais satur kaadu skaitli, piem. m1=12, m2=1 u.t.t.

Uzdevums - pa vienam nolasiit mainiigos no m1 liidz m10 un noprinteet tos. Nepaarakstot kodaa print $m1; print $m2; u.t.t.

Taa teikt vajadziigs kaut kaads cikls, kursh pats veido shos mainiigo nosaukumus.

 

Jautaajums - kaa?

Link to comment
Share on other sites

<code><font color="#000000">
<font color="#0000CC"><?php
$m1</font><font color="#006600">=</font><font color="#0000CC">123</font><font color="#006600">;
</font><font color="#0000CC">$m2</font><font color="#006600">=</font><font color="#0000CC">343</font><font color="#006600">;
</font><font color="#0000CC">$m3</font><font color="#006600">=</font><font color="#0000CC">355</font><font color="#006600">;
for(</font><font color="#0000CC">$i</font><font color="#006600">=</font><font color="#0000CC">1</font><font color="#006600">;</font><font color="#0000CC">$i</font><font color="#006600"><=</font><font color="#0000CC">3</font><font color="#006600">;</font><font color="#0000CC">$i</font><font color="#006600">++)echo </font><font color="#0000CC">$m$i</font><font color="#006600">.</font><font color="#CC0000">' '</font><font color="#006600">;
</font><font color="#0000CC">?></font>
</font>
</code>

Link to comment
Share on other sites

×
×
  • Create New...