php—nn乘法表

  这么一个东西我居然写了一下午。ORZ

<?php
    
$n=1;
    
//$_GET['n']不为空时$d=$_GET['n']
    
if (!empty($_GET['n']))
    
{
        
$n=$_GET['n'];
    
}
    
//第一个循环
    
for ($a=1;$a<=$n;$a++)
    
{
        
//第二个循环
        
for ($b=1;$b<=$a;$b++)
        
{
            
//计算相乘结果
            
$c=$a*$b;
            
echo "$a x $b = $c  ";
        
}
        
echo '<br />';
    
}
?>
Google Reader Yahoo Facebook Twitter Digg FriendFeed Delicious Google Translate
这篇日志发表于2007年12月26日 19:25。 你可以订阅该日志的所有评论通过 RSS 2.0。 你可以发表评论,或者引用通告

4 条回应

评论(4)引用通告(0)

  1. 丁丁亚

    看不懂

    整个很晕

    2007/12/27 01:26 | #1
  2. iCoke

    ^哈哈~这个也太简单了吧~

    2007/12/27 16:08 | #2
  3. 寒晗

    看的真晕
    都差点没找到写评论的地方

    2007/12/27 18:43 | #3
  4. 释然

    埃肚!
    埃肚!
    装主你还是说中文吧! :grin:

    2007/12/30 15:00 | #4

发表评论

:wink: :-| :-x :twisted: :) 8-O :( :roll: :-P :oops: :-o :mrgreen: :lol: :idea: :-D :evil: :cry: 8) :arrow: :-? :?: :!:

(Ctrl+Enter)

XHTML:你可以使用这些标签:<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>