Php instances: the sum of three numbers between 1 and 9 is equal to 15 .? Php $ j0; $ k0; $ m0; for ($ i0; $ i1000; $ I ++) {$ a1rand (1, 9); $ a2rand (1, 9 ); $ a3rand (1, 9); if ($ a1 + $ a2 + $ a315) {$ m ++; if ($ a1 $ a2or $ a1 $ a3or $ a2 $ $ J = 0; $ k = 0; $ m = 0;
For ($ I = 0; I I <1000; $ I ++)
{
$ A1 = rand (1, 9 );
$ A2 = rand (1, 9 );
$ A3 = rand (1, 9 );
If ($ a1 + $ a2 + $ a3 = 15)
{
$ M ++;
If ($ a1 ===$ a2 or $ a1 ===$ a3 or $ a2 ===$ a3)
{
Echo "duplicate value". $ a1. "+". $ a2. "+". $ a3. "\ n ";
$ J ++;
}
Else
{
Echo $ a1. "+". $ a2. "+". $ a3. "= 15". "\ n ";
$ K ++;
}
}
}
Echo "equal to 15 times ". $ m. "Times \ n equals 15, but there are repeated times ". $ j. "Times \ n equals 15 and no duplicates ". $ k. "Times ";
Http://www.bkjia.com/PHPjc/364661.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/364661.htmlTechArticle? Php $ j = 0; $ k = 0; $ m = 0; for ($ I = 0; $ I 1000; $ I ++) {$ a1 = rand (); $ a2 = rand (); $ a3 = rand (); if ($ a1 + $ a2 + $ a3 = 15) {$ m ++; if ($ a1 ===$ a2 or $ a1 ===$ a3 or $ a2 ===$...