How to use for language
饮浮觞 zyq
饮浮觞 zyq 2019-10-09 22:53:17
0
2
1443

(1) Generate a file, which is required to have 1000 lines, each line is the number of lines in the line;

(2) Calculate the number of all characters in the file;

(3) All ten numbers 0 1 2 3 4 5 6 7 8 9 appear several times in the statistical file.


饮浮觞 zyq
饮浮觞 zyq

reply all(2)
邓

<?php $arr=array();$sum=0;for($i=0;$i<10;$i ){ $arr[$i]=0;}
for( $i=1;$i<=1000;$i ){ echo $i.'<hr>'; $k=$i; for($j=0;$j<=3;$j ){ $ m=$k; 10;$i ){ echo $i.' appears: '.$arr[$i].'times'.'<hr>'; $sum =$arr[$i];}
echo 'Total Characters: '.$sum.'piece';?>

Take a rough look and this should be able to achieve the above three points. (Characters do not include spaces)

ringa_lee

for language?

You are talking about a for loop, right? To achieve these three requirements?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template