Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Kann mir mal bitte jemand denn Quelltext vom 8-Damen Problem zusenden? :confused:

Raver_Chriss@web.de

Berlin-Raver

Die anderen interessiert´s vielleicht auch!

/* damen.c */

#include <stdio.h>

typedef enum { FALSE,TRUE } BOOLEAN ;

BOOLEAN hpt_diag[16],neb_diag[16],zeil[9];

int spalt[9],c=0;

BOOLEAN versuch(int);

void ausgabe(void);

void main()

{

int i;

for (i=1; i < 16; i++)

hpt_diag = neb_diag = TRUE;

for (i=1; i < 9; zeil[i++]=TRUE);

versuch(1);

printf("\n%d Loesungen gefunden\n",c);

return;

}

void ausgabe()

{

int i;

for (i=1; i<9; printf("%4d",spalt[i++]));

printf("\n");

c++;

return;

}

BOOLEAN versuch(int i)

{

void ausgabe(void);

int j;

for (j=1; j<9 ; j++)

if (hpt_diag[i+j-1] && neb_diag[i-j+8]

&& zeil[j])

{

spalt = j;

hpt_diag[i+j-1] = neb_diag[i-j+8] =

zeil[j] = FALSE;

if (i < 8)

versuch(i+1);

else

ausgabe();

hpt_diag[i+j-1] = neb_diag[i-j+8] =

zeil[j] = TRUE;

}

return TRUE;

}

Allerdings ist das ohne eine brauchbare Anleitung schwer lesbar. Ich habe hier ein Buch, in dem das ziemlich genau beschrieben und gut ausdokumentiert ist, wenn ich mal Zeit habe schreibe ich´s vielleicht ab.

<FONT COLOR="#a62a2a" SIZE="1">[ 21. November 2001 09:13: Beitrag 1 mal editiert, zuletzt von Crush ]</font>

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.