Как приложить исходники?
Исходный код модуля Uni1:
unit Unit1;
{$mode objfpc}{$H+}
interface
uses Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, Spin;
type
{ TForm1 }
TForm1 = class(TForm) FloatSpinEdit1: TFloatSpinEdit; FloatSpinEdit2: TFloatSpinEdit; Label1: TLabel; Label2: TLabel; Label3: TLabel; procedure FloatSpinEdit1Change(Sender: TObject); procedure FloatSpinEdit2Change(Sender: TObject); procedure FormCreate(Sender: TObject); procedure Label1Click(Sender: TObject); private { private declarations } public { public declarations } end;
var Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure calcsquare;begin Form1.Label3.Caption:='Площадь кольца '+FloatToStr(3.141592*Form1.FloatSpinEdit1.Value*Form1.FloatSpinEdit1.Value-3.141592*Form1.FloatSpinEdit2.Value*Form1.FloatSpinEdit2.Value);end;
procedure checkvalues;begin if (Form1.FloatSpinEdit2.Value>Form1.FloatSpinEdit1.Value) then begin Showmessage('Внешний радиус не может быть меньше внутреннего'); Form1.FloatSpinEdit2.Value:=Form1.FloatSpinEdit1.Value; end else begin calcsquare; end;end;
procedure TForm1.Label1Click(Sender: TObject);begin
end;
procedure TForm1.FloatSpinEdit1Change(Sender: TObject);begin checkvalues;end;
procedure TForm1.FloatSpinEdit2Change(Sender: TObject);begin checkvalues;end;
procedure TForm1.FormCreate(Sender: TObject);begin
end;
end.
Исходный код формы Form1
object Form1: TForm1 Left = 357 Height = 180 Top = 212 Width = 311 Caption = 'Расчет площади кольца' ClientHeight = 180 ClientWidth = 311 LCLVersion = '1.0.12.0' object Label1: TLabel Left = 37 Height = 16 Top = 16 Width = 94 Caption = 'Внешний радиус' ParentColor = False OnClick = Label1Click end object Label2: TLabel Left = 39 Height = 16 Top = 82 Width = 108 Caption = 'Внутренний радиус' ParentColor = False end object FloatSpinEdit1: TFloatSpinEdit Left = 40 Height = 23 Top = 32 Width = 234 Increment = 1 MaxValue = 100 MinValue = 0 OnChange = FloatSpinEdit1Change TabOrder = 0 Value = 0 end object FloatSpinEdit2: TFloatSpinEdit Left = 40 Height = 23 Top = 102 Width = 234 Increment = 1 MaxValue = 100 MinValue = 0 OnChange = FloatSpinEdit2Change TabOrder = 1 Value = 0 end object Label3: TLabel Left = 40 Height = 16 Top = 147 Width = 7 Caption = 'S' ParentColor = False endend
Program Qwerty123777;
uses crt;
var
x,y:real;
begin
writeln('*** Alphaeus is thinking... ***');
writeln('*** OK ***');
writeln();
writeln('Программа находит значение функции y=(2x-4)/(3xx+11)');
write('Введите значение х '); readln (x);
y:=(2*x-4)/(3*x*x+11);
writeln('*** Вычисляю... ***');
writeln('y=', y:8:2); ;
end.
using System;
namespace ConsoleApp7
{
class Program
{
static void Main(string[] args)
{
long b = 1;
Console.Write("Введите а: ");
long a = Convert.ToInt32(Console.ReadLine());
a = a * a;
b = a * a;
b = b * b;
Console.WriteLine("a^8 = " + b);
b = (b * a);
Console.WriteLine("a^10 = " + b);
Console.Read();
}
}
}
<u>PascalABC.NET 3.3.5, сборка 1662 от 29.04.2018</u>
<u>Внимание! Если программа не работает, обновите версию!</u>
begin
var f:=ArrRandom(9,-50,50); f.Println;
var k:=f.Select(t->t*t).ToArray; k.Println
end.
<u>Пример</u>
39 0 28 31 -35 -2 -11 -48 -32
1521 0 784 961 1225 4 121 2304 1024