21 lines
643 B
C
21 lines
643 B
C
#include <stdio.h>
|
|
#include <string.h>
|
|
#include "turing.h"
|
|
|
|
int main() {
|
|
// Anfangszustand des Bandes
|
|
char band[100] = "1100#"; // Das ist z.B. die Zahl 12 in Binär
|
|
int pos = strlen(band) - 2; // Position des letzten Bits vor dem #
|
|
|
|
printf("Vorher: %s\n", band);
|
|
anzeigen(band, pos); // Zeigt das Band mit Positionsmarkierung
|
|
ausfuehren(band, pos); // Führt die Addition durch
|
|
printf("Nachher: %s\n", band);
|
|
anzeigen(band, pos); // Zeigt das neue Band
|
|
|
|
// Zur Ausgabe vom Program folgender Befehlt in die Konsole: gcc -o dualaddi dualaddi.c adturing.c bildsch.c fehler.c
|
|
//./dualaddi
|
|
|
|
return 0;
|
|
}
|