Last login: Tue Dec 25 18:36:38 on ttys000
OpenAppLab-no-MacBook-Air:~ openapplab$ cd Desktop
OpenAppLab-no-MacBook-Air:Desktop openapplab$ cd unko
OpenAppLab-no-MacBook-Air:unko openapplab$ atom alg6-2.c
-bash: atom: command not found
OpenAppLab-no-MacBook-Air:unko openapplab$ ls
2-3.c		alg3-1.c	logo.pbm	prog01.c~
3-2.c		alg4-2.c	p1.pbm		prog02.c
a.out		alg5-2.c	p2.pbm		prog02.c~
alg1-4.c	circle		prog01.c	ryo.pbm
OpenAppLab-no-MacBook-Air:unko openapplab$ atom alg6-2.c
OpenAppLab-no-MacBook-Air:unko openapplab$ gcc alg6-2.c
alg6-2.c:4:1: warning: type specifier missing, defaults to 'int'
      [-Wimplicit-int]
partiotion(int A[],int p,int r)
^
alg6-2.c:30:5: warning: implicit declaration of function 'partition' is invalid
      in C99 [-Wimplicit-function-declaration]
  p=partition(A,0,i);
    ^
2 warnings generated.
Undefined symbols for architecture x86_64:
  "_partition", referenced from:
      _main in alg6-2-4ff43f.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
OpenAppLab-no-MacBook-Air:unko openapplab$ gcc alg6-2.c
alg6-2.c:4:1: warning: type specifier missing, defaults to 'int'
      [-Wimplicit-int]
partiotion(int A[],int p,int r)
^
alg6-2.c:30:5: warning: implicit declaration of function 'partition' is invalid
      in C99 [-Wimplicit-function-declaration]
  p=partition(A,0,i);
    ^
2 warnings generated.
Undefined symbols for architecture x86_64:
  "_partition", referenced from:
      _main in alg6-2-d37754.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
OpenAppLab-no-MacBook-Air:unko openapplab$ gcc alg6-2.c
alg6-2.c:30:5: warning: implicit declaration of function 'partition' is invalid
      in C99 [-Wimplicit-function-declaration]
  p=partition(A,0,i);
    ^
1 warning generated.
Undefined symbols for architecture x86_64:
  "_partition", referenced from:
      _main in alg6-2-f7bf56.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
OpenAppLab-no-MacBook-Air:unko openapplab$ gcc alg6-2.c
OpenAppLab-no-MacBook-Air:unko openapplab$ ./a.out
12
13 19 9 5 12 8 7 4 21 2 6 11
[0] 19 9 5 12 8 7 4 21 2 6 11OpenAppLab-no-MacBook-Air:unko openapplab$ gcc alg6-2.c
OpenAppLab-no-MacBook-Air:unko openapplab$ ./a.out
12
13 19 9 5 12 8 7 4 21 2 6 11
9 5 8 7 4 2 6 [11] 21 13 19 12
OpenAppLab-no-MacBook-Air:unko openapplab$ S
PAM Authentication
Password: 
Last login: Thu Dec 27 2018 07:43:54 +0900 from x123239
Oracle Corporation     SunOS 5.11      11.3    January 2017

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- Solaris:
  - Computer Exercise Room 1 and 2  ... std1dc2 - std1dc46, std2dc2 - std2dc46
  - Standard Environment Server     ... solsv171 - solsv174
- macOS:
  - Computer Exercise Room 5 and 6  ... std5dc2 - std5dc50, std6dc2 - std6dc50
  - iLab 1 and 2                ... ilab1dc2 - ilab1dc49, ilab2dc2 - ilab2dc49
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Terminal type is xterm-256color.                                        
Terminal type is xterm-256color.                                        
Erase is backspace.
sshsv171:~ s1260011[51]$ cd alg1
sshsv171:alg1 s1260011[52]$ ls
'#aig3-1.c#'  a.out      alg1-1.c   alg2-1.c   alg4-1.c~  alg6-1.c~
'#alg1-1#'    aig3-1     alg1-1.c~  alg2-1.c~  alg4-2.c   core
'#alg2-1.c#'  aig3-1.c   alg1-2.c   alg2-2.c   alg5-1.c
'#alg5-2.c#'  aig3-1.c~  alg1-2.c~  alg2-2.c~  alg5-1.c~
'#alg6-1.c#'  alg1-1     alg1-3.c   alg4-1.c   alg6-1.c
sshsv171:alg1 s1260011[53]$ emacs alg6-1.c

File Edit Options Buffers Tools C Help                                          
int main(){
  unsigned short A[VMAX], B[VMAX];

  scanf("%d", &n);

  //A = malloc(sizeof(short)*n+1);                                              
  //B = malloc(sizeof(short)*n+1);                                              

  for(i=0;i<n;i++) scanf("%d",&A[i]);
  CountingSort(A,B,VMAX);

  for(i=1;i<=n;i++){
    printf("%d",B[i]);
    if(i==n){
      printf("\n");
    }else printf(" ");
  }
  return 0;
}


