Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What does the nesting of for loops in Pascal mean?
What does the nesting of for loops in Pascal mean?

var n,i,j:integer;//Declare variables n,i,j are all integers

begin //Program starts

readln(n ); //Read in N

for i:=1 to n do //I changes from 1 to N

begin //BEGIN means that there are multiple FOR loops in front Statement

//For loop without BEGIN END

//By default, only the following statement will be executed

//Each FOR loop will be executed< /p>

//The statements from this BEGIN to END;

for j:=1 to i do

write('&');

//This FOR J.. loop will only execute without BEGIN END

//WRITE ('&')

//without executing WRITELN

writeln; //Line break, only executed in each FOR I loop

//Execution, not in FOR J

end; //This is FOR I. . The end of the loop

//This is where the statement is executed each time in the loop

readln() //Read a carriage return character to see the result

end.