Dmitry Telenkov 1 dia atrás
pai
commit
a795907889
2 arquivos alterados com 27 adições e 2 exclusões
  1. 27 2
      c/test/main.c
  2. BIN
      c/test/main.exe

+ 27 - 2
c/test/main.c

@@ -1,5 +1,7 @@
 #include <stdio.h>
 
+static int input_test(void);
+
 int main()
 {
     char c1 = 'A';
@@ -8,7 +10,30 @@ int main()
     //puts(&c1);
 
     //char s[] = {'A', 'B', 'C', 0};
-    char s[] = "ABC\n\x2";
-    puts(s);
+    char *s = "hello world";
+    printf("hello: %-20s asfqwef\n", s);
+    printf("%#d = %#x = %#o\n", 100, 100, 100);
+
+    long long val = 0x1234567890adcdef;
+    printf("%#lx\n", val);
+
+    input_test();
     return 0;
 }
+
+// ввод символов
+static int input_test(void)
+{
+    char c1, c2;
+    //c = getchar();
+    //printf("code: %#X: ", c);
+
+    scanf("%c%*c", &c1);
+    printf("code1: %d\n", c1);
+    
+    scanf("%c", &c2);
+    printf("code2: %d\n", c2);
+
+    return 0; 
+}
+

BIN
c/test/main.exe