Var N:integer;
r1,r2,r3:byte;
Begin
WriteLn('Введите четырёхзначное число');
ReadLn(N);
r1:=N div 1000;
r2:=(N div 100) mod 10;
r3:=(N div 10) mod 10;
N:=N mod 10;
Write((r1<>r2)and(r1<>r3)and(r1<>N)and(r2<>r3)and(r2<>N)and(r3<>N))
End.
// PascalABC.Net
var arr: array [1..15] of integer;
count: integer;
begin
for var i:=1 to 15 do
arr[i]:=random(1, 300);
writeln('Исходный массив: ');
for var i:=1 to 15 do
write(arr[i], ' ');
writeln();
count:=0;
for var i:=1 to 15 do
if (arr[i] > 9) and (arr[i] < 100) then
count += 1;
writeln('Количество двузначных чисел: ', count);
end.
Unit proect;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, TAGraph, TASeries,Forms,
Controls, Graphics, Dialogs, StdCtrls, ExtCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Chart1: TChart;
Image5: TImage;
Image6: TImage;
Label14: TLabel;
Label15: TLabel;
SinSeries2: TLineSeries;
CosSeries2: TLineSeries;
Edit3: TEdit;
Edit4: TEdit;
Edit1: TEdit;
Edit2: TEdit;
Image1: TImage;
Image2: TImage;
Image3: TImage;
Image4: TImage;
Label1: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Shape1: TShape;
SinSeries: TLineSeries;
CosSeries: TLineSeries;
SinCosSeries: TLineSeries;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
const
N = 100;
MIN = -5;
MAX = 5;
var
x, step: Double;
a, b, c, d, i: Integer;
begin
//чистка предыдущих графиков
//считываем переменные
a := StrToInt(Edit1.Text);
b := StrToInt(Edit2.Text);
c := StrToInt(Edit3.Text);
d := StrToInt(Edit4.Text);
step := (MAX - MIN) / N;
x := MIN;
repeat
//Рисуем графики
SinSeries.AddXY(x, a * x + b);
CosSeries.AddXY(x, d * x * x);
SinCosSeries.AddXY(x, c / x);
SinSeries2.AddXY(x, sin(x));
CosSeries2.AddXY(x, cos(x));
//следующий
x := x + step;
until x > MAX;
end;
end.
Наливаем в емкость 8л 5 +3 л воды, в емкосте 5л остается 2 литра, выливаем воду из 8л емкости, наливаем 2 литра в емкость 8л, затем наливаем 5 литров в емкость 8л, в емкосте 8л 5+2=7 литров воды, выливаем из 5л емкости 1 литр и получаем 4 литра.