瀏覽代碼

first commit

foxdie 2 年之前
父節點
當前提交
1b94453a3f
共有 6 個文件被更改,包括 61 次插入0 次删除
  1. 二進制
      tannebaumv1
  2. 16 0
      tannebaumv1.c
  3. 二進制
      tannebaumv2
  4. 29 0
      tannebaumv2.c
  5. 二進制
      tannebaumv3
  6. 16 0
      tannebaumv3.c

二進制
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    | |");
+
+}

二進制
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);
+    }
+
+}

二進制
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]);
+	}
+    }
+
+}