foxdie преди 2 години
родител
ревизия
1b94453a3f
променени са 6 файла, в които са добавени 61 реда и са изтрити 0 реда
  1. BIN
      tannebaumv1
  2. 16 0
      tannebaumv1.c
  3. BIN
      tannebaumv2
  4. 29 0
      tannebaumv2.c
  5. BIN
      tannebaumv3
  6. 16 0
      tannebaumv3.c

BIN
tannebaumv1


+ 16 - 0
tannebaumv1.c

@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+void main() {
+    printf("\n     ^");
+    printf("\n    ^^^");
+    printf("\n   ^^^^^");
+    printf("\n  ^^^^^^^");
+    printf("\n ^^^^^^^^^");
+    printf("\n^^^^^^^^^^^");
+    printf("\n    | |");
+    printf("\n    | |");
+    printf("\n    |@|");
+    printf("\n    | |");
+    printf("\n    | |");
+
+}

BIN
tannebaumv2


+ 29 - 0
tannebaumv2.c

@@ -0,0 +1,29 @@
+#include <stdio.h>
+
+void main() {
+    char leaf[] = "^";
+    char trunk[] = "|   |";
+    const int height = 32;
+    int length = height;
+    int lineno;
+    int columns;
+
+    for (lineno = 0; lineno <= height; lineno++ ) {
+	for (columns = 0; columns < length; columns++) {
+	    printf(" ");
+	}
+	for (columns = 0; columns < lineno*2; columns++) {
+             printf("%s",leaf);
+	}
+	printf("\n");
+	length--;
+    }
+    
+    for (lineno = 0; lineno < height/2; lineno++){
+	for (columns = 0; columns < height-2; columns++) {
+	    printf(" ");
+	}
+            printf("%s\n",trunk);
+    }
+
+}

BIN
tannebaumv3


+ 16 - 0
tannebaumv3.c

@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+void main() {
+    char display[2][3] = {
+	{'_','_'},
+	{'|','|','|'}
+    };
+    
+    int i, j;
+    for (i = 0; i < 2; i++) {
+        for (j = 0; j > 3; j++) {
+	    printf("%d ", display[i][j]);
+	}
+    }
+
+}