Nesting Nesting Nesting Nesting Nesting Execute the above program, and the output is as follows:
最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。 Perl language allows the use of another loop within one loop, and here are a few examples to illustrate this concept. 5.24.1. Grammar #
for syntax of the loop statement:for(init;condition;increment){for(init;condition;increment){statement(s);}statement(s);}
while syntax of the loop statement:while(condition){while(condition){statement(s);}statement(s);}
do...while syntax of the loop statement:do{statement(s);do{statement(s);}while(condition);}while(condition);
until the syntax of the loop statement:until(condition){until(condition){statement(s);}statement(s);}
foreach syntax of the loop statement:foreach$a(@listA){foreach$b(@listB){statement(s);}statement(s);} Example #
#!/usr/bin/perl$a=0;$b=0;# outer loop while($a<3 b='$b\\n";$b=$b+1;}$a=$a+1;print"a' ){$b=0;# < =$a\\n\\n";} circulation internal pre while($b<3){print"a=$a,> a = 0, b = 0 a = 0, b = 1 a = 0, b = 2 a = 1 a = 1, b = 0 a = 1, b = 1 a = 1, b = 2 a = 2 a = 2, b = 0 a = 2, b = 1 a = 2, b = 2 a = 3