Einzelnen Beitrag anzeigen

Dave_lernt_Delphi

Registriert seit: 19. Mär 2009
29 Beiträge
 
Delphi 7 Enterprise
 
#9

Re: 4 Variablen sollen = 1302 sein.

  Alt 26. Apr 2009, 17:01
// Edit: Ah, da war wohl einer schneller als ich (siehe oben)
trotzdem sende ich meine Antwort nochmal


Zitat von markus5766h:
Hallo,
kann es sein, das "DAS" eine Primfaktoren-Analyse werden soll ?
Hey, das ist ne gute Idee
Muss ich mal machen ...
Aber diesmal wird es keine Primfaktorenanalyse...

So, jetzt nochmal 'ne Rückmeldung:

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var w, x, y, z : Integer;
begin
for w := Low(1) to High(9) do
begin
  for x := Low(1) to High(9999) do
  begin
    for y := Low(1) to High(9999) do
    begin
      for z := Low(1) to High(9999) do
      begin
        if w * x - y + z = 1302 then
        begin
Label1.Caption := IntToStr(w);
Label2.Caption := IntToStr(x);
Label3.Caption := IntToStr(y);
Label4.Caption := IntToStr(z);
        end;
      end;
    end;
  end;
end;
end;

end.
Das habe ich jetzt geschrieben, man kann das Programm auch starten, wenn man allerdings auf den Button1 klickt passiert nichts und dann kann man garnichts mehr machen, das komplette Programm bleibt stehen und man kann es nicht mehr übers "X" schließen
mhhhhh.... komisch... aber vielleicht kann mir ja nochmal jemand helfen Wäre cool,
Euer Dave
Ich hoffe, dass ihr mir helfen könnt.
Viele Grüße aus dem Kreis Hildesheim
  Mit Zitat antworten Zitat