| 1:2:
 3:
 4:
 5:
 6:
 7:
 8:
 9:
 10:
 11:
 12:
 13:
 14:
 15:
 16:
 17:
 18:
 19:
 20:
 21:
 22:
 23:
 24:
 25:
 26:
 27:
 28:
 29:
 30:
 31:
 32:
 33:
 34:
 35:
 36:
 37:
 38:
 39:
 40:
 41:
 42:
 43:
 44:
 45:
 46:
 47:
 48:
 49:
 50:
 51:
 52:
 53:
 54:
 55:
 56:
 57:
 58:
 59:
 60:
 61:
 62:
 63:
 64:
 65:
 66:
 67:
 68:
 69:
 70:
 71:
 72:
 73:
 74:
 75:
 76:
 77:
 78:
 79:
 80:
 81:
 82:
 83:
 84:
 85:
 86:
 87:
 88:
 89:
 90:
 91:
 92:
 93:
 94:
 95:
 96:
 97:
 98:
 99:
 100:
 101:
 102:
 103:
 104:
 105:
 106:
 107:
 
 | var
 x,laenge,ggtint,zahl1,zahl2,rest1,rest2,rest3,code:integer;
 z1str,z2str,ggt:string;
 Form1: TForm1;
 
 implementation
 
 {$R *.DFM}
 
 procedure TForm1.Button2Click(Sender: TObject);
 begin
 close
 end;
 
 procedure TForm1.Button1Click(Sender: TObject);
 begin
 
 Label4.caption:='';
 Label5.caption:='';
 
 
 val(edit1.text,zahl1,code);
 val(edit2.text,zahl2,code);
 
 
 if zahl1 mod zahl2 = 0 then
 begin
 str(zahl2,ggt);
 end
 
 else
 begin
 rest1:=zahl1 mod zahl2;
 begin;
 
 if zahl2 mod rest1 = 0 then
 begin
 str(rest1,ggt);
 end
 
 else
 begin
 rest2:=zahl2 mod rest1;
 begin;
 
 repeat
 begin
 rest3:= rest1 mod rest2;
 rest1:=rest2;
 rest2:=rest3;
 end;
 until
 rest3=0;
 str(rest1,ggt);
 end;
 end;
 end;
 end;
 
 
 begin
 val(ggt,ggtint,code);
 zahl1:=zahl1 div ggtint;
 zahl2:=zahl2 div ggtint;
 str(zahl1,z1str);
 str(zahl2,z2str);
 label4.caption:=z1str;
 label5.caption:=z2str;
 end;
 
 
 
 begin
 if length(z1str) >= length(z2str) then
 begin
 Laenge:=length(z1str);
 end
 else
 begin
 Laenge:=length(z2str);
 end;
 
 
 Shape2.width:=Laenge*9;
 
 
 if label4.width >= label5.width then
 label5.width:=label4.width
 else
 label4.width:=label5.width;
 end;
 
 end;
 
 
 end.
 |