Поправил в трех проектах пути к bin
LightPT - Read...(prompt) - больше комбинаций Loop_If_2_Sum в Tasks1Loops.pas
This commit is contained in:
parent
b471da4499
commit
50a0fdc4fc
|
|
@ -41,7 +41,7 @@
|
|||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\..\bin\</OutputPath>
|
||||
<OutputPath>..\..\bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>3</WarningLevel>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\..\bin\</OutputPath>
|
||||
<OutputPath>..\bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\..\..\bin\</OutputPath>
|
||||
<OutputPath>..\bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
|
|
|
|||
|
|
@ -111,10 +111,42 @@ function MatrRandomReal(m: integer; n: integer): array [,] of real;
|
|||
|
||||
/// Выводит приглашение к вводу и возвращает значение типа integer, введенное с клавиатуры
|
||||
function ReadInteger(prompt: string): integer;
|
||||
/// Выводит приглашение к вводу и возвращает два значения типа integer, введенные с клавиатуры
|
||||
function ReadInteger2(prompt: string): (integer, integer);
|
||||
/// Выводит приглашение к вводу и возвращает значение типа integer, введенное с клавиатуры
|
||||
function ReadlnInteger(prompt: string): integer;
|
||||
/// Выводит приглашение к вводу и возвращает два значения типа integer, введенные с клавиатуры
|
||||
function ReadInteger2(prompt: string): (integer, integer);
|
||||
/// Выводит приглашение к вводу и возвращает два значения типа integer, введенные с клавиатуры
|
||||
function ReadlnInteger2(prompt: string): (integer, integer);
|
||||
/// Выводит приглашение к вводу и возвращает три значения типа integer, введенные с клавиатуры
|
||||
function ReadInteger3(prompt: string): (integer, integer, integer);
|
||||
/// Выводит приглашение к вводу и возвращает три значения типа integer, введенные с клавиатуры
|
||||
function ReadlnInteger3(prompt: string): (integer, integer, integer);
|
||||
/// Выводит приглашение к вводу и возвращает три значения типа integer, введенные с клавиатуры
|
||||
function ReadInteger4(prompt: string): (integer, integer, integer, integer);
|
||||
/// Выводит приглашение к вводу и возвращает три значения типа integer, введенные с клавиатуры
|
||||
function ReadlnInteger4(prompt: string): (integer, integer, integer, integer);
|
||||
|
||||
/// Выводит приглашение к вводу и возвращает значение типа real, введенное с клавиатуры
|
||||
function ReadReal(prompt: string): real;
|
||||
/// Выводит приглашение к вводу и возвращает значение типа real, введенное с клавиатуры
|
||||
function ReadlnReal(prompt: string): real;
|
||||
/// Выводит приглашение к вводу и возвращает два значения типа real, введенные с клавиатуры
|
||||
function ReadReal2(prompt: string): (real, real);
|
||||
/// Выводит приглашение к вводу и возвращает два значения типа real, введенные с клавиатуры
|
||||
function ReadlnReal2(prompt: string): (real, real);
|
||||
/// Выводит приглашение к вводу и возвращает три значения типа real, введенные с клавиатуры
|
||||
function ReadReal3(prompt: string): (real, real, real);
|
||||
/// Выводит приглашение к вводу и возвращает три значения типа real, введенные с клавиатуры
|
||||
function ReadlnReal3(prompt: string): (real, real, real);
|
||||
/// Выводит приглашение к вводу и возвращает три значения типа real, введенные с клавиатуры
|
||||
function ReadReal4(prompt: string): (real, real, real, real);
|
||||
/// Выводит приглашение к вводу и возвращает три значения типа real, введенные с клавиатуры
|
||||
function ReadlnReal4(prompt: string): (real, real, real, real);
|
||||
|
||||
/// Выводит приглашение к вводу и возвращает значение типа char, введенное с клавиатуры
|
||||
function ReadChar(prompt: string): char;
|
||||
/// Выводит приглашение к вводу и возвращает значение типа char, введенное с клавиатуры
|
||||
function ReadlnChar(prompt: string): char;
|
||||
|
||||
/// Выводит приглашение к вводу и возвращает значение типа string, введенное с клавиатуры
|
||||
function ReadString(prompt: string): string;
|
||||
|
|
@ -1957,46 +1989,131 @@ begin
|
|||
InputList.Add(x);
|
||||
end;
|
||||
|
||||
/// Возвращает двумерный массив размера m x n, заполненный случайными вещественными значениями
|
||||
function MatrRandomReal(m: integer; n: integer): array [,] of real := MatrRandomReal(m,n,0,10);
|
||||
|
||||
/// Выводит приглашение к вводу и возвращает значение типа integer, введенное с клавиатуры
|
||||
procedure ReadRemainderAction;
|
||||
begin
|
||||
if not IsPT then
|
||||
begin
|
||||
OutputList.RemoveAt(OutputList.Count - 1);
|
||||
OutputList.RemoveAt(OutputList.Count - 1);
|
||||
CreateNewLineBeforeMessage := False;
|
||||
end;
|
||||
end;
|
||||
|
||||
function ReadInteger(prompt: string): integer;
|
||||
begin
|
||||
Result := PABCSystem.ReadInteger(prompt);
|
||||
if IsPT then exit;
|
||||
OutputList.RemoveAt(OutputList.Count - 1);
|
||||
OutputList.RemoveAt(OutputList.Count - 1);
|
||||
CreateNewLineBeforeMessage := False;
|
||||
ReadRemainderAction;
|
||||
end;
|
||||
|
||||
/// Выводит приглашение к вводу и возвращает значение типа integer, введенное с клавиатуры
|
||||
function ReadlnInteger(prompt: string): integer;
|
||||
begin
|
||||
Result := PABCSystem.ReadlnInteger(prompt);
|
||||
if IsPT then exit;
|
||||
OutputList.RemoveAt(OutputList.Count - 1);
|
||||
OutputList.RemoveAt(OutputList.Count - 1);
|
||||
CreateNewLineBeforeMessage := False;
|
||||
ReadRemainderAction;
|
||||
end;
|
||||
|
||||
/// Выводит приглашение к вводу и возвращает два значения типа integer, введенные с клавиатуры
|
||||
function ReadInteger2(prompt: string): (integer, integer);
|
||||
begin
|
||||
Result := PABCSystem.ReadInteger2(prompt);
|
||||
if IsPT then exit;
|
||||
OutputList.RemoveAt(OutputList.Count - 1);
|
||||
OutputList.RemoveAt(OutputList.Count - 1);
|
||||
CreateNewLineBeforeMessage := False;
|
||||
ReadRemainderAction;
|
||||
end;
|
||||
|
||||
function ReadlnInteger2(prompt: string): (integer,integer);
|
||||
begin
|
||||
Result := PABCSystem.ReadlnInteger2(prompt);
|
||||
ReadRemainderAction;
|
||||
end;
|
||||
|
||||
function ReadInteger3(prompt: string): (integer,integer,integer);
|
||||
begin
|
||||
Result := PABCSystem.ReadInteger3(prompt);
|
||||
ReadRemainderAction;
|
||||
end;
|
||||
|
||||
function ReadlnInteger3(prompt: string): (integer,integer,integer);
|
||||
begin
|
||||
Result := PABCSystem.ReadlnInteger3(prompt);
|
||||
ReadRemainderAction;
|
||||
end;
|
||||
|
||||
function ReadInteger4(prompt: string): (integer, integer,integer,integer);
|
||||
begin
|
||||
Result := PABCSystem.ReadInteger4(prompt);
|
||||
ReadRemainderAction;
|
||||
end;
|
||||
|
||||
function ReadlnInteger4(prompt: string): (integer,integer,integer,integer);
|
||||
begin
|
||||
Result := PABCSystem.ReadlnInteger4(prompt);
|
||||
ReadRemainderAction;
|
||||
end;
|
||||
|
||||
function ReadReal(prompt: string): real;
|
||||
begin
|
||||
Result := PABCSystem.ReadReal(prompt);
|
||||
ReadRemainderAction;
|
||||
end;
|
||||
|
||||
function ReadlnReal(prompt: string): real;
|
||||
begin
|
||||
Result := PABCSystem.ReadlnReal(prompt);
|
||||
ReadRemainderAction;
|
||||
end;
|
||||
|
||||
function ReadReal2(prompt: string): (real, real);
|
||||
begin
|
||||
Result := PABCSystem.ReadReal2(prompt);
|
||||
ReadRemainderAction;
|
||||
end;
|
||||
|
||||
function ReadlnReal2(prompt: string): (real, real);
|
||||
begin
|
||||
Result := PABCSystem.ReadlnReal2(prompt);
|
||||
ReadRemainderAction;
|
||||
end;
|
||||
|
||||
function ReadReal3(prompt: string): (real, real, real);
|
||||
begin
|
||||
Result := PABCSystem.ReadReal3(prompt);
|
||||
ReadRemainderAction;
|
||||
end;
|
||||
|
||||
function ReadlnReal3(prompt: string): (real, real, real);
|
||||
begin
|
||||
Result := PABCSystem.ReadlnReal3(prompt);
|
||||
ReadRemainderAction;
|
||||
end;
|
||||
|
||||
function ReadReal4(prompt: string): (real, real, real, real);
|
||||
begin
|
||||
Result := PABCSystem.ReadReal4(prompt);
|
||||
ReadRemainderAction;
|
||||
end;
|
||||
|
||||
function ReadlnReal4(prompt: string): (real, real, real, real);
|
||||
begin
|
||||
Result := PABCSystem.ReadlnReal4(prompt);
|
||||
ReadRemainderAction;
|
||||
end;
|
||||
|
||||
function ReadChar(prompt: string): char;
|
||||
begin
|
||||
Result := PABCSystem.ReadChar(prompt);
|
||||
ReadRemainderAction;
|
||||
end;
|
||||
|
||||
function ReadlnChar(prompt: string): char;
|
||||
begin
|
||||
Result := PABCSystem.ReadlnChar(prompt);
|
||||
ReadRemainderAction;
|
||||
end;
|
||||
|
||||
|
||||
function ReadString(prompt: string): string;
|
||||
begin
|
||||
Result := PABCSystem.ReadString(prompt);
|
||||
if IsPT then exit;
|
||||
OutputList.RemoveAt(OutputList.Count - 1);
|
||||
OutputList.RemoveAt(OutputList.Count - 1);
|
||||
CreateNewLineBeforeMessage := False;
|
||||
ReadRemainderAction;
|
||||
end;
|
||||
|
||||
function ReadlnString(prompt: string) := ReadString(prompt);
|
||||
|
|
|
|||
|
|
@ -337,7 +337,14 @@ begin
|
|||
FilterOnlyNumbersAndBools;
|
||||
var N := Int(0);
|
||||
CheckData(Input := |cInt|*(N+1));
|
||||
GenerateTests(10,tInt(1,10)*n);
|
||||
|
||||
TestCount := 5;
|
||||
GenerateTestData := tnum -> begin
|
||||
var N := Random(5, 10);
|
||||
var a := ArrRandomInteger(N,1,10);
|
||||
InputList.AddTestData(|N|+a);
|
||||
end;
|
||||
|
||||
var s := 0;
|
||||
for var i:=1 to N do
|
||||
if Int(i).IsEven then
|
||||
|
|
|
|||
Loading…
Reference in a new issue