§@ªÌ¡G®L»F¼Ý 2010-12-15 ªìª©
¤@Ó«ü¥O
·í§ÚÌ·Q«½Æ°µ«Ü¦h¦¸®É
§ÚÌ¥i¥H«½Æ½Æ»s«Ü¦h¦¸
©ÎªÌ´N¥Î For....Next °j°é
«ü©w¤@ÓÅܼÆ
Åý¥¦¥Ñ°_ÈÅܨì²×È
¦p For i=1 to 5
´N¬OÅýi¥Ñ1 Åܨì5
¨C¦¸¥[1
°õ¦æ¨ì Next ®É
«h¸õ¦^«½Æ
·íi>5 ®É
´N¤£¦A¸õ¦^
ª½±µ¦V¤U¨«¤F
¥H¤U´N¬OÅý i ¥Ñ1 ¨ì5
¦P®É§â¦Û¤v¦C¦L¥X¨Óªº¨Ò¤l
BASIC:
' *******************************************
' for loop statement (For..Next)
' *******************************************
Sub ForLoop()
' Declare local variable
Dim i as Integer
Debug.Print " ";"**** For statement ***";
Debug.Print
For i=1 to 5
Debug.Print " ";"i=";
Debug.Print " ";i;
Debug.Print
Next
End Sub
C++:
/* ******************************************* */
/* for loop statement (For..Next) */
/* ******************************************* */
void ForLoop() {
/* Declare local variable */
int i;
printf(" %s" , "**** For statement ***");
printf("\n" );
for (i=1; i<= 5; i++) {
printf(" %s" , "i=");
printf(" %d" , i);
printf("\n" );
}
}
JAVA:
// *******************************************
// for loop statement (For..Next)
// *******************************************
public void ForLoop() {
// Declare local variable
int i;
System.out.print(" "+"**** For statement ***" );
System.out.println("");
for (i=1; i<= 5; i++) {
System.out.print(" "+"i=" );
System.out.print(" "+i );
System.out.println("");
}
}
C#:
/* ******************************************* */
/* for loop statement (For..Next) */
/* ******************************************* */
public void ForLoop() {
/* Declare local variable */
int i;
Console.Write(" "+"**** For statement ***");
Console.WriteLine("");
for (i=1; i<= 5; i++) {
Console.Write(" "+"i=");
Console.Write(" "+i);
Console.WriteLine("");
}
}
PHP:
/* ******************************************* */
/* for loop statement (For..Next) */
/* ******************************************* */
function ForLoop() {
/* Declare local variable */
echo " "."**** For statement ***";
echo "";
for ($i=1; $i<= 5; $i++) {
echo " "."i=";
echo " ".$i;
echo "";
}
}