jonass Posted January 1, 2004 Report Share Posted January 1, 2004 Kaa panaakt lai dators izvada cik reizes skaitlim , kursh daliits ar citu skaitli ir veseli rezultaati. Piem. $skaitlis = 33; es gribu shito ar 10 izdaliit, buus 3 veselas reizes ar atlikumu, bet jaapanaak lai vinjsh izvada cik ir vesels rezultaats. shajaa gadiijumaa 3, bet $skaitlis var buut arii cits skaitlis. while (($skaitlis / 10) == vesels rezultats) { dariit to un to } apm taa. Link to comment Share on other sites More sharing options...
Robis Posted January 1, 2004 Report Share Posted January 1, 2004 Vispaar jau while darbojas kameer izteiksme ir patiesa, bet tev jau cik es sapratu, vajadzeeja daliit, kameer nav vesels rezultaats ? :unsure: Es nesapratu tavu domu, bet peec tavas dotaas while izteiksmes sanaak shaadi: while (($skaitlis % 10) == 0) { dariit to un to } Link to comment Share on other sites More sharing options...
Kaklz Posted January 1, 2004 Report Share Posted January 1, 2004 Kaa panaakt lai dators izvada cik reizes skaitlim , kursh daliits ar citu skaitli ir veseli rezultaati.Piem. $skaitlis = 33; es gribu shito ar 10 izdaliit, buus 3 veselas reizes ar atlikumu, bet jaapanaak lai vinjsh izvada cik ir vesels rezultaats. shajaa gadiijumaa 3, bet $skaitlis var buut arii cits skaitlis. while (($skaitlis / 10) == vesels rezultats) { dariit to un to } apm taa. echo floor($skaitlis / $dalitajs); Tavā gadījumā: floor($skaitlis / 10) Floor noapaļo skaitļus uz leju, tas nozīmē, ka dalot to pašu 33 ar 10, iegūsim 3.3, kas noapaļots uz leju būs 3. http://lv.php.net/floor Link to comment Share on other sites More sharing options...
jonass Posted January 1, 2004 Author Report Share Posted January 1, 2004 paldies :) Link to comment Share on other sites More sharing options...
Recommended Posts