Language: C

Last login: Fri Jun 23 00:14:43 on console
hasegawanarumi-no-MacBook-Air:~ RAMUNE$ ls
Applications	Documents	Library		Music		Public
Desktop		Downloads	Movies		Pictures	UoA
hasegawanarumi-no-MacBook-Air:~ RAMUNE$ pwd
/Users/RAMUNE
hasegawanarumi-no-MacBook-Air:~ RAMUNE$ cd UoA/2nd/1sem/Alg/
hasegawanarumi-no-MacBook-Air:Alg RAMUNE$ ls
ALDS1_1_A-in1.txt	Lec6			topic1-1.c
Doubly.c		Lec7			w00.pdf
Lec3			Lec8			w02.pdf
Lec4			a.out
Lec5			lec2-3.c
hasegawanarumi-no-MacBook-Air:Alg RAMUNE$ mkdir Lec9
hasegawanarumi-no-MacBook-Air:Alg RAMUNE$ bash
bash-3.2$ pwd
/Users/RAMUNE/UoA/2nd/1sem/Alg
bash-3.2$ cd Lec9
bash-3.2$ gcc Complete.c 
Complete.c:17:5: error: use of undeclared identifier 'for9i'
    for9i=0;i<n;i++){
    ^
Complete.c:17:20: error: expected ';' after expression
    for9i=0;i<n;i++){
                   ^
                   ;
Complete.c:17:20: error: expected expression
Complete.c:17:14: warning: relational comparison result unused
      [-Wunused-comparison]
    for9i=0;i<n;i++){
            ~^~
1 warning and 3 errors generated.
bash-3.2$ gcc Complete.c 
bash-3.2$ ./a.out
5
7 8 1 2 3

^C
bash-3.2$ gcc Complete.c 
bash-3.2$ ./a.out
5
7 8 1 2 3
bash-3.2$ gcc Complete.c 
bash-3.2$ ./a.out
5
7 8 1 2 3
T[0] key = 7 , parent = 7
T[1] key = 8 , parent = 7
T[2] key = 1 , parent = 8
T[3] key = 2 , parent = 8
T[4] key = 3 , parent = 1
bash-3.2$ gcc Complete.c 
bash-3.2$ ./a.out
5
7 8 1 2 3
T[0] key = 1234723 , parent = 0
T[1] key = 7 , parent = 1234723
T[2] key = 8 , parent = 7
T[3] key = 1 , parent = 7
T[4] key = 2 , parent = 8
bash-3.2$ gcc Complete.c 
bash-3.2$ ./a.out
5
7 8 1 2 3
T[1] key = 7 , parent = 1234914
T[2] key = 8 , parent = 7
T[3] key = 1 , parent = 7
T[4] key = 2 , parent = 8
T[5] key = 3 , parent = 8
bash-3.2$ gcc Complete.c 
bash-3.2$ ./a.out
5
7 8 1 2 3
T[1] key = 7 , parent = -1
T[2] key = 8 , parent = 7
T[3] key = 1 , parent = 7
T[4] key = 2 , parent = 8
T[5] key = 3 , parent = 8
bash-3.2$ gcc Complete.c 
bash-3.2$ ./a.out
5
7 8 1 2 3
node 1 : key = 7, left key = 8, right key = 1, parent = -1 
node 2 : key = 8, left key = 2, right key = 3, parent = 7 
node 3 : key = 1, left key = -1, right key = -1, parent = 7 
node 4 : key = 2, left key = -1, right key = -1, parent = 8 
node 5 : key = 3, left key = -1, right key = -1, parent = 8 
bash-3.2$ gcc Complete.c 
Complete.c:37:27: warning: implicit declaration of function 'print' is invalid
      in C99 [-Wimplicit-function-declaration]
        if(T[i].right!=-1)print("right key = %d, ",T[i].right);
                          ^
1 warning generated.
Undefined symbols for architecture x86_64:
  "_print", referenced from:
      _main in Complete-da8c2d.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
bash-3.2$ gcc Complete.c 
bash-3.2$ ./a.out
5
7 8 1 2 3
node 1 : key = 7 left key = 8, right key = 1, 
node 2 : key = 8 parent key = 7, left key = 2, right key = 3, 
node 3 : key = 1 parent key = 7, 
node 4 : key = 2 parent key = 8, 
node 5 : key = 3 parent key = 8, 
bash-3.2$ 

Compiler output:
main.c:1:1: error: unknown type name 'Last'
    1 | Last login: Fri Jun 23 00:14:43 on console
      | ^~~~
main.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
    1 | Last login: Fri Jun 23 00:14:43 on console
      |           ^
main.c:7:48: error: invalid suffix "nd" on integer constant
    7 | hasegawanarumi-no-MacBook-Air:~ RAMUNE$ cd UoA/2nd/1sem/Alg/
      |                                                ^~~
main.c:7:52: error: invalid suffix "sem" on integer constant
    7 | hasegawanarumi-no-MacBook-Air:~ RAMUNE$ cd UoA/2nd/1sem/Alg/
      |                                                    ^~~~
main.c:9:56: error: invalid suffix "c" on floating constant
    9 | ALDS1_1_A-in1.txt       Lec6                    topic1-1.c
      |                                                        ^~~
main.c:13:30: error: invalid suffix "c" on floating constant
   13 | Lec5                    lec2-3.c
      |                              ^~~
main.c:16:6: error: invalid suffix "$" on floating constant
   16 | bash-3.2$ pwd
      |      ^~~~
main.c:17:19: error: invalid suffix "nd" on integer constant
   17 | /Users/RAMUNE/UoA/2nd/1sem/Alg
      |                   ^~~
main.c:17:23: error: invalid suffix "sem" on integer constant
   17 | /Users/RAMUNE/UoA/2nd/1sem/Alg
      |                       ^~~~
main.c:18:6: error: invalid suffix "$" on floating constant
   18 | bash-3.2$ cd Lec9
      |      ^~~~
main.c:19:6: error: invalid suffix "$" on floating constant
   19 | bash-3.2$ gcc Complete.c
      |      ^~~~
main.c:20:54: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
   20 | Complete.c:17:5: error: use of undeclared identifier 'for9i'
      |                                                      ^~~~~~~
main.c:21:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   21 |     for9i=0;i<n;i++){
      |              ^
main.c:21:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   21 |     for9i=0;i<n;i++){
      |                  ^~
main.c:33:6: error: invalid suffix "$" on floating constant
   33 | bash-3.2$ gcc Complete.c
      |      ^~~~
main.c:34:6: error: invalid suffix "$" on floating constant
   34 | bash-3.2$ ./a.out
      |      ^~~~
main.c:39:6: error: invalid suffix "$" on floating constant
   39 | bash-3.2$ gcc Complete.c
      |      ^~~~
main.c:40:6: error: invalid suffix "$" on floating constant
   40 | bash-3.2$ ./a.out
      |      ^~~~
main.c:43:6: error: invalid suffix "$" on floating constant
   43 | bash-3.2$ gcc Complete.c
      |      ^~~~
main.c:44:6: error: invalid suffix "$" on floating constant
   44 | bash-3.2$ ./a.out
      |      ^~~~
main.c:52:6: error: invalid suffix "$" on floating constant
   52 | bash-3.2$ gcc Complete.c
      |      ^~~~
main.c:53:6: error: invalid suffix "$" on floating constant
   53 | bash-3.2$ ./a.out
      |      ^~~~
main.c:61:6: error: invalid suffix "$" on floating constant
   61 | bash-3.2$ gcc Complete.c
      |      ^~~~
main.c:62:6: error: invalid suffix "$" on floating constant
   62 | bash-3.2$ ./a.out
      |      ^~~~
main.c:70:6: error: invalid suffix "$" on floating constant
   70 | bash-3.2$ gcc Complete.c
      |      ^~~~
main.c:71:6: error: invalid suffix "$" on floating constant
   71 | bash-3.2$ ./a.out
      |      ^~~~
main.c:79:6: error: invalid suffix "$" on floating constant
   79 | bash-3.2$ gcc Complete.c
      |      ^~~~
main.c:80:6: error: invalid suffix "$" on floating constant
   80 | bash-3.2$ ./a.out
      |      ^~~~
main.c:88:6: error: invalid suffix "$" on floating constant
   88 | bash-3.2$ gcc Complete.c
      |      ^~~~
main.c:89:61: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
   89 | Complete.c:37:27: warning: implicit declaration of function 'print' is invalid
      |                                                             ^~~~~~~
main.c:99:6: error: invalid suffix "$" on floating constant
   99 | bash-3.2$ gcc Complete.c
      |      ^~~~
main.c:100:6: error: invalid suffix "$" on floating constant
  100 | bash-3.2$ ./a.out
      |      ^~~~
main.c:108:6: error: invalid suffix "$" on floating constant
  108 | bash-3.2$
      |      ^~~~