我做的樹~大致上也都差不多^^"
<html>
<head>
<title>聖誕樹</title>
</head>
<body>
<script language="JavaScript"><!--
str=x=prompt("你要幾層聖誕樹?")
alert("你想要的是"+str+"層聖誕樹!!")
f=x*2
y=1
z=x-3
e=f
document.write("<center>")
for (j=0;j<x;j++)
{
for (i=0;i<y;i++)
{document.write("*")}
for (i=0;i<f;i++)
{document.write("<font color='white'>")
document.write("o")
document.write("</font>")}
for (i=0;i<y;i++)
{document.write("*")}
f=f-2
y=y+2;
document.write("<br>")
}
for (j=0;j<z;j++)
{ document.write("*")
for (i=0;i<e;i++)
{document.write("<font color='white'>")
document.write("o")
document.write("</font>")}
document.write("*")
document.write("</br>")
}
document.write("</center>")
// --></script>
</body>
</html>
--
※ 發信站: 批踢踢實業坊(ptt.csie.ntu.edu.tw)
◆ From: 218.184.52.18
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 5 篇):