Einzelnen Beitrag anzeigen

problemstoffe

Registriert seit: 6. Jun 2007
16 Beiträge
 
#7

Re: Sieb des Eratosthenes: Von Pascal nach R-Pascal

  Alt 3. Mai 2008, 16:27
Kommt das so hin? Oder immernoch völlig falsch?
Delphi-Quellcode:
  i := 2;
 m1: if i>100 then goto m2
 zahl[i] := i;            
  p := 2;
 goto m1;
 M2: If not p <= 100 Then Goto M3;

     v := 2;
     Goto M2;
   M3: If not v*p <= 100 Then Goto M4;
         
            zahl[v*p] := 0;
            Goto M3;
      M4: v := v+1;
       
     i := p+1;
      M5: If not (i<=100) and (zahl[i] = 0) Then Goto M6;
       i := i + 1;
          Goto M5;
      M6: p := i;
  Mit Zitat antworten Zitat