如何在不使用goto语句的情况下在Paskal中为n循环禁止?

时间:2016-09-09 13:56:28

标签: loops for-loop break

    procedure obrada(a,b:matrica; m,n,m1,n1:integer);
    var i,j:integer; uslov:boolean;
    begin
     if (m<>n1) and (n<>m1) then writeln('Nema transponovanja.')
     else
     begin
     uslov:=true;
     for i:=1 to m do
      for j:=1 to n do
       if (a[i,j]<>b[j,i]) then
       begin
            uslov:=false;//What should I write here to go directly on line 
                           'writeln('Can not be obtained');' and stop checking this 
                            matrix when this codition is true?
       end;
     if uslov then writeln('The first matrix can not be obtained by transposing other ')
     else writeln('Can not be obtained');
     end;
    end; 

如果您知道某些解决方案,请阅读此代码块中的注释并回答该问题。 :)

1 个答案:

答案 0 :(得分:0)

您似乎想要使用Break;

此处有更多信息:http://www.freepascal.org/docs-html/rtl/system/break.html