Autor Beitrag
LonghornUser
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Mo 14.11.05 08:54 
Hallo.
Kann mir jemand sagen, was dieses Programm macht ?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
PROGRAM aufgabe4;
  uses wincrt;
  var k,r:byte;
        a:array[1..5] of byte;

BEGIN
  FOR r := 1 TO 5 DO BEGIN
    a[r] := 1;
    FOR k := r - 1 DOWNTO 2 DO
      a[k] := a[k] + a[k-1];
    FOR k := 1 TO r DO
      Write(a[k]);
    Writeln;
  END;


END.

Danke schonmal.

Moderiert von user profile iconGausi: Code- durch Delphi-Tags ersetzt
Moderiert von user profile iconTino: Titel geändert.
noidic
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 851

Win 2000 Win XP Vista
D7 Ent, SharpDevelop 2.2
BeitragVerfasst: Mo 14.11.05 08:59 
Grob überflogen müsste das Programm die Zahlenfolge 1 1 2 3 4 ausgeben.

_________________
Bravery calls my name in the sound of the wind in the night...
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mo 14.11.05 09:01 
Es löst die Aufgabe 4?

_________________
We are, we were and will not be.
LonghornUser Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Mo 14.11.05 09:04 
es gibt

1
11
121
1331
14641

aus, aber was ist das genau ??? Was leistet es ?
noidic
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 851

Win 2000 Win XP Vista
D7 Ent, SharpDevelop 2.2
BeitragVerfasst: Mo 14.11.05 09:06 
stimmt, hab mich in den Schleifen verwurstelt, is noch zu früh :)

Ich vermute, die Aufgabe ( Schule? ) ist, herauszufinden, was das Programm tut. Sinn hats anscheinend keinen.

_________________
Bravery calls my name in the sound of the wind in the night...
LonghornUser Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Mo 14.11.05 09:08 
Die Frage in der Arbeit ist, was leistet der Algorithmus ?
Hilfe !!!
noidic
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 851

Win 2000 Win XP Vista
D7 Ent, SharpDevelop 2.2
BeitragVerfasst: Mo 14.11.05 09:08 
Wobei... wenn ich mir das Ergebnis so anschaue, sieht mir das doch arg nach nem Pascalschen Dreieck aus...

_________________
Bravery calls my name in the sound of the wind in the night...
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mo 14.11.05 09:08 
Na siehst du, du weisst ja doch, was es macht. Und dieses Dreieck, was dabei rauskommt, nennt man Pascalsches Dreieck. Die Zahlen nennt man auch Binomialkoeffizienten. Am Besten mal bei Wikipedia vorbeischauen, da gibts bestimmt ne gute Erklärung für.

_________________
We are, we were and will not be.
Grishnak
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 221

Windows XP Home
Delphi 7 PE, Delphi 2005 PE
BeitragVerfasst: Mo 14.11.05 09:09 
ausblenden Quelltext
1:
2:
3:
4:
5:
    1
   1 1
  1 2 1
 1 3 3 1
1 4 6 4 1


Die Summe zweier Zahlen wird mittig daruntergeschrieben. Bsp.: 3 + 1 = 4

_________________
Mach' etwas idiotensicher und irgendjemand erfindet einen besseren Idioten!
noidic
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 851

Win 2000 Win XP Vista
D7 Ent, SharpDevelop 2.2
BeitragVerfasst: Mo 14.11.05 09:10 
Nebenbei.. gehts dabei um ne Klassenarbeit? Klingt so... und da ist Internet freigegeben? Ich war zur falschen Zeit in der Schule...

_________________
Bravery calls my name in the sound of the wind in the night...
LonghornUser Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Mo 14.11.05 09:13 
Danke !!!!!!!! Melde mich heute nachmittag nochmal
jojo-sp
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 317

Windows XP Prof, Vista Ultimate & Home Premium, Windows 7
Delphi 7 Enterprise, Delphi 2009
BeitragVerfasst: Mo 14.11.05 10:03 
Das waren noch Zeiten, als man zum Spicken ein Papier benutzen musste...
Aber der Lehrer wird sich doch hoffentlich ein Protokoll der besuchten Webseiten ansehen können, sonst fehlt ja völlig der Nervenkitzel beim Spicken :-)

_________________
Ist der Ruf erst ruiniert, lebts sich gänzlich ungeniert...
Wilhelm Busch (1832 - 1908)