java 展示 1~10
程式碼
class ForDemo1 {
public static void main(String[] args) {
int i;
for (i = 1; i <= 10; i++) {
System.out.println(i);
}
}
}
程式碼
class ForDemo1 {
public static void main(String[] args) {
int i;
for (i = 1; i <= 10; i++) {
System.out.println(i);
}
}
}
javascript 展示 1~10
程式碼
<HTML>
<HEAD>
</HEAD>
<BODY>
<script language="JavaScript">
for (i=1; i<=10; i=i+1)
{
document.write(i );
}
</SCRIPT>
</BODY>
</HTML>
沒有留言:
張貼留言