Переведите числа в десятичную систему счисления 110110(двоичной системе счисления) 126(в восмеричной системе численя) 1D9(в шестнадцатеричной системе) 6-ой класс Хееелп
type TForm1 = class(TForm) Image1: TImage; Button1: TButton; OpenDialog1: TOpenDialog; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;
var Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject); begin if OpenDialog1.Execute then begin Image1.Picture.LoadFromFile(OpenDialog1.FileName); Image1.Stretch:=true; Image1.Left:=form1.Width div 2-image1.Width div 2; Image1.top:=form1.Height div 2-image1.Height div 2; end end;
1. В приведенном коде ошибка. Не хватает ";" в третьей строке снизу. 2. Немного изменим ваш код и получим искомое значение x Искомое число х = 16293
var x, y, a, b, k: integer;
begin k:=10000; repeat x:=k; a := 0; b := 0; y := 1; while x > 0 do begin if (x mod 10) mod 2 = 0 then a := a * 10 + x mod 10 else begin y := y * 10; b := b * 10 + x mod 10 end; x := x div 10 end; a := a * y + b; k := k + 1; until a = 26391; writeln(a:8, k-1:8); end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Image1: TImage;
Button1: TButton;
OpenDialog1: TOpenDialog;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
begin
Image1.Picture.LoadFromFile(OpenDialog1.FileName);
Image1.Stretch:=true;
Image1.Left:=form1.Width div 2-image1.Width div 2;
Image1.top:=form1.Height div 2-image1.Height div 2;
end
end;
end.