2 years ago, the rubbish written by himself was not able to understand the change, and begged the great God to run up.

Source: Internet
Author: User
Tags mul
This post was last edited by bbbbbjt46 on 2013-06-15 22:19:24

function Shuzu ($a 0, $a 1, $a 2, $a 3, $a 4, $a 5, $a 6, $a 7, $a 8, $a 9) {
Global $arrr;
Global $bianliang;
$arrr =array ((int) ("$a 0" * $bianliang), (int) ("$a 1" * $bianliang), (int) ("$a 2" * $bianliang), (int) ("$a 3" * $bianliang), ( int) ("$a 4" * $bianliang), (int) ("$a 5" * $bianliang), (int) ("$a 6" * $bianliang), (int) ("$a 7" * $bianliang), (int) ("$a 8" *$ Bianliang), (int) ("$a 9" * $bianliang));
Return $arrr
;}

function Chu ($a, $b) {
$ddrrr = "";
foreach ($a as $arr = = $key) {
$ddrrr. = (int) ($key/$b). " ";
}
$ddrrr = (Explode (", trim ($ddrrr)));
return $ddrrr;
}


function Zongshu ($bianliang, $chushizhi, $time, $time 1) {

$a 0 =shuzu (11,7,8,6,5,8,13,5,11,7);
$a 1 =shuzu (15,7,7,8,3,11,4,9,15,12);
$a 2 =shuzu (8,11,15,4,13,12,9,8,11,15);
$a 3 =shuzu (5,7,7,8,3,9,15,15,8,11);
$a 4 =shuzu (12,8,14,5,7,9,14,13,11,8);
$a 5 =shuzu (9,5,8,7,6,8,7,12,11,5);
$a 6 =shuzu (8,15,5,6,7,4,6,9,9,7);
$a 7 =shuzu (4,6,6,8,7,6,5,5,9,12);
$a 8 =shuzu (6,6,8,5,9,12,7,5,9,11);
$a 9 =shuzu (8,11,7,7,5,6,4,9,11,9);


$chushi =substr ($time, 0,5);
$dangqian =substr ($time 1,0,5);




$beishu = 100;
$beicha = (int) (($dangqian-$chushi)/$beishu);


$chushi 100=substr ($chushi, 2, 1);
$chushi 10=substr ($chushi, 3, 1);
$chushi 1=substr ($chushi, 4, 1);
$chushi 0=substr ($time, 5, 1);
$dangqian 100=substr ($dangqian, 2, 1);
$dangqian 10=substr ($dangqian, 3, 1);
$dangqian 1=substr ($dangqian, 4, 1);
$dangqian 0=substr ($time 1,5,1);

$xiaoshi = 0;
$num = "";
$dqnumfor = "";
$gnum = "";
$xhzongshu = "";
if ($chushi 10< $dangqian 10) {
For ($_i= $chushi 10+1;$_i< $dangqian 10;$_i++) {
for ($t =0; $t <=9; $t + +) {
$num +=${"a". $_i}[$t];
}
}}

if ($chushi 10> $dangqian 10) {
For ($_i= $chushi 10+1;$_i< $dangqian 10+10;$_i++) {
if ($_i>=10) {
$jian 10=$_i-10;
}
else{
$jian 10=$_i;
}
for ($t =0; $t <=9; $t + +) {
$num +=${"a". $jian 10}[$t];
}
}
}


if ($chushi 10== $dangqian 10&& $chushi 100!= $dangqian 100) {
{
For ($_i= $chushi 10+1;$_i< $dangqian 10+10;$_i++) {//$_i=8;$_i<7+10;$_i++
if ($_i>=10) {
$jian 10=$_i-10;
}
else{
$jian 10=$_i;
}
for ($t =0; $t <=9; $t + +) {
$num +=${"a". $jian 10}[$t];
}
}
}
}

$dnum = 0;
$xnum = 0;
$swnum = 0;

Calculation of single-digit values
if ($chushi 10== $dangqian 10&& $chushi 100== $dangqian 100) {
For ($_i= $chushi 1;$_i< $dangqian 1;$_i++) {
$swnum +=${"a". $dangqian 10}[$_i];
}
$gnum = $swnum;
}
else{
for ($j = $chushi 1; $j <=9; $j + +) {//initial digit and
$dnum +=${"a". $chushi 10}[$j];
}

for ($p =0; $p <= $dangqian 1; $p + +) {//current digit and
$xnum +=${"a". $dangqian 10}[$p];
}

$gnum = $dnum + $xnum;
}
Calculation of Multiples
if ($beicha >=1&& $chushi 10== $dangqian 10&& $beicha <2) {
for ($_i=0;$_i<=9;$_i++) {
$xhzongshu +=array_sum (${"a". $_i});
}
$xhzongshu *= $beicha-1;
}
else{
for ($_i=0;$_i<=9;$_i++) {
$xhzongshu +=array_sum (${"a". $_i});
}
$xhzongshu *= $beicha;
}
$wocao = "";
if (($dangqian 100-$chushi) >=2&& $chushi 10== $dangqian 10) {
for ($_i=0;$_i<=9;$_i++) {
$wocao +=array_sum (${"a". $_i});
$beishuzhi = 0;
}
if ($chushi 1<= $dangqian 1) {
$beishuzhi = 1;
}

$wocao *= $beicha-$beishuzhi;
$xhzongshu = $wocao;
}


$arraychuzhi = ${"a". $dangqian 10}; Array in addition to values




if ($dangqian 0<=2) {
$rrr =chu ($arraychuzhi, 2);
$xiaoshi = $rrr [$dangqian 1];
}
if ($dangqian 0<=5&& $dangqian 0>2) {
$rrr =chu ($arraychuzhi, 3);
$xiaoshi = $rrr [$dangqian 1];

}
if ($dangqian 0<8&& $dangqian 0>5) {
$rrr =chu ($arraychuzhi, 4);
$xiaoshi = $rrr [$dangqian 1];

}


$zongshu = $num + $gnum + $xhzongshu-$xiaoshi + $chushizhi;
return $zongshu;
}

echo "
". Zongshu (0.5,400,1321232550,time ());


Reply to discussion (solution)

Do not know what you are doing, and how to run up?

Do not know what you are doing, and how to run up?

$num + $gnum + $xhzongshu-$xiaoshi

These 3 parameters were previously a value that changed over time, and are now unchanged.

Although there is a global $bianliang;
But this $bianliang is not assigned

Can you tell me what you are doing with this code?
Code sucks, it's recommended to rewrite

Although there is a global $bianliang;
But this $bianliang is not assigned

Can you tell me what you are doing with this code?
Code sucks, it's recommended to rewrite

Specifically get a number that can be antagonistic (total) by increasing it over time without timing.

Although there is a global $bianliang;
But this $bianliang is not assigned

Can you tell me what you are doing with this code?
Code sucks, it's recommended to rewrite

Global $bianliang;
This is assigned in the parameters of the Zongshu function. Isn't that okay?

function Shuzu ($a 0, $a 1, $a 2, $a 3, $a 4, $a 5, $a 6, $a 7, $a 8, $a 9) {
Global $arrr;
Global $bianliang; This is not assigned externally.
$arrr =array ((int) ("$a 0" * $bianliang),...
return $arrr; This will always return an array (0,0,0,0,0,0,0,0,0,0)

Another, you say is can reverse the number, show where?

function Shuzu ($a 0, $a 1, $a 2, $a 3, $a 4, $a 5, $a 6, $a 7, $a 8, $a 9) {
Global $arrr;
Global $bianliang; This is not assigned externally.
$arrr =array ((int) ("$a 0" * $bianliang),...
return $arrr; This will always return an array (0,0,0,0,0,0,0,0,0,0)

Another, you say is can reverse the number, show where?
Turn the time back. The total number obtained at the same time is always the same.
In fact, this code is very boring, just in the virtual a specified time range, in the indefinite time of the increase in the amount of times and get a total.
This code is really rubbish, I despise myself ...


I also noticed that $arrr never got the value ....
Is there a function that can multiply all the arguments in an array by a function of a number?
For example, array (34,6,2,9) so that each value inside is multiplied by a number?

$a = Array (34,6,2,9), Array_walk ($a, ' mul ', 2);p Rint_r ($a), function Mul (& $item, $key, $num) {  $item *= $num;}
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.