rt

解决方案 »

  1.   

    遍历吧var
      x : boolean;
      arr : array[0..10] of boolean;
      i : integer;
    begin
        x := true;
        for i := 0 to length(arr) do
            arr[i] := true;
        for i:= 0 to length(arr) do
        begin
            if arr[i] = false then
            begin
                x := false;
                break;
            end;
        end;
    if x = true then
        showmessage('全部为true');
    end;
      

  2.   

    各个元素依次and操作,如果有一个为false,则退出,
    各个元素依次or 操作,如果为1,则退出;
      

  3.   

    var
        alltrue,allfalse:boolean;
        arr : array of boolean;
    begin
      alltrue := true;
      allfalse := false;
      for i:= low(arr) to high(arr) do
      begin
        alltrue := alltrue and arr[i];
        allfalse := allfalse or arr[i];
      end;
      if alltrue then showmessage('全真!');
      if not allfalse then showmessage('全假!');
    end;
      

  4.   

    var
        alltrue,notallfalse:boolean;
        arr : array of boolean;
    begin
      alltrue := true;
      notallfalse := false;
      for i:= low(arr) to high(arr) do
      begin
        alltrue := alltrue and arr[i];
        notallfalse := notallfalse or arr[i];
        if (not alltrue) and (notallfalse) break;
      end;
      if alltrue then showmessage('全真!');
      if not notallfalse then showmessage('全假!');
    end;