控制台?效果如下:
js代码如下:
<script type="text/javascript">console.log("九九乘法表")
for ( var x = 1 x <= 9 x++) {
str=""
for ( var y = 1 y <= x y++) {
str+=x + "*" + y + " = " + (x * y)+" "
}
console.log(str)
}
</script>
<script type="text/javascript" >
function step(){
for(i=1i<=9i++){
for(j=1j<=ij++){
document.write(i+"x"+j+"="+i*j +" ")
}document.write("<br/>")
}
}
</script>
</head>
<body onload="step()">
</body>
扩展资料
c语言九九乘法表,具体代码如下,在Trubo2.0、3.0、VC6.0下正常。
#include <stdio.h>
int main(void)
{
int i,j
for (i=1i<=9i++)
{
for (j=1j<=ij++)
printf("%d*%d=%d ",j,i,j*i)
printf("\n")
}
}