0
$testCase="";
$strength="";
$i="";$j="";$sum=0;
$submit=$_POST['submit'];
if(!empty($submit))
{
$testCase=$_POST['TestCase'];
$strength=$_POST['strength'];
}
else
{
die("Please enter the Number of <strong>test case</strong><br/> and <strong> Strength of audience</strong>");
}
while($testCase>0)
{
for($i=1;$strength;$i=$i+1)
{
$user[$i]=$i+1;
}
//finding the total number of stickers
for($j=1;$j<$strength;$j=$j+1)
{
$sum=$sum+$user[$j];
}
}
echo "The total number of <strong>Stickers</strong> are = " . $sum;
這裏很少有問題。爲什麼當$ 0與0進行比較時,$ testCase被初始化爲一個字符串? – David 2014-11-03 13:43:20
你有一個無限循環,'$ testCase'在循環中永遠不會改變。 – jeroen 2014-11-03 13:44:26
$ testCase沒有被初始化爲任何東西。 – aps240 2014-11-03 13:51:47