Hallo zusammen.
Wir haben die Aufgabe zwei zahlen zu dividieren.
meine beispielzahlen sind : 29:8
hier meine Datei..
Delphi-Quelltext
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:
| var Form1: TForm1; divis, divid, X, zahl : Integer ;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject); begin divid := StrToInt (edit1.text) ; divis := StrToInt (edit2.text) ; zahl := divid ; X := 0 ; while zahl < divid Do begin zahl := zahl - divis ; X := X + 1 ; end;
label1.caption := IntToStr(divid) + ' = ' + IntToStr(X) + ' * ' + IntToStr(divis) + ' + ' + IntToStr(Zahl) ;
end; end. |
...
jedoch bei der ausgabe wenn ich alles eingebe kommt 29 = 0*8+29
obwohl 29=3*8+5 erscheinen müsste..
wo ist mein fehler ???????????
bitte um schnelle hilfe !
SiFi
Moderiert von
Martok: Delphi-Tags hinzugefügt