Language: C

^[[ALast login: Sun May 29 16:41:22 on ttys000
jumpei-no-MacBook-Air:~ jumpeiokawara$ ssh s1230067@sshgate.u-aizu.ac.jp
PAM Authentication
Password: 
Last login: Wed Jun 01 2016 08:05:49 +0900 from p7215-ipngn1101
Oracle Corporation     SunOS 5.11      11.3    February 2016

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Please log in to one of the hosts listed below.

- Solaris11: 
  - Computer Exercise Room 1 and 2  ... stdrsv1121 - stdrsv1125
  - Computer Exercise Room 3 and 4  ... std34rsv1 - std34rsv5
  - Hardware Workshop 1, 2, 3 and 4 ... stdrsv2121 - stdrsv2128
  - CALL Lab 1 and 2                ... stdrsv3121 - stdrsv3123
  - Faculty room                    ... prorsv1 - prorsv10
- OS X 10.9
  - Computer Exercise Room 5 and 6  ... std5dc2 - std5dc50, std6dc2 - std6dc50
  - iLab 1 and 2                    ... ilab1dc2 - ilab1dc49, ilab2dc2 - ilab2dc49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
sshsv1{s1230067}51: 


sshsv1{s1230067}51: cd 2016_1
sshsv1{s1230067}52: cd Exercises
sshsv1{s1230067}53: cd Java
sshsv1{s1230067}54: ls -l
total 60
drwxr-xr-x 5 s1230067 student 4096  4??? 13 11:32 Ex1
drwxr-xr-x 2 s1230067 student 4096  4??? 13 10:18 Ex10
drwxr-xr-x 2 s1230067 student 4096  4??? 13 10:18 Ex11
drwxr-xr-x 2 s1230067 student 4096  4??? 13 10:18 Ex12
drwxr-xr-x 2 s1230067 student 4096  4??? 13 10:18 Ex13
drwxr-xr-x 2 s1230067 student 4096  4??? 13 10:18 Ex14
drwxr-xr-x 2 s1230067 student 4096  4??? 13 10:18 Ex15
drwxr-xr-x 2 s1230067 student 4096  4??? 20 12:14 Ex2
drwxr-xr-x 2 s1230067 student 4096  5??? 11 10:56 Ex3
drwxr-xr-x 2 s1230067 student 4096  5??? 11 12:44 Ex4
drwxr-xr-x 2 s1230067 student 4096  5??? 18 13:34 Ex5
drwxr-xr-x 2 s1230067 student 4096  5??? 25 13:13 Ex6
drwxr-xr-x 2 s1230067 student 4096  4??? 13 10:18 Ex7
drwxr-xr-x 2 s1230067 student 4096  4??? 13 10:18 Ex8
drwxr-xr-x 2 s1230067 student 4096  4??? 13 10:18 Ex9
sshsv1{s1230067}55: cd Ex6
sshsv1{s1230067}56: ls
Circle.class         Rectangle.class    TestFigures.java
Confusing.class      Rhombus.class      TestFigures.java~
Confusing.java       Shape.class        TestFiguresEquals.class
Confusing.java~      Square.class       TestFiguresEquals.java
Parallelogram.class  TestFigures.class  TestFiguresEquals.java~
sshsv1{s1230067}57: cd ..
sshsv1{s1230067}58: cd Ex7
sshsv1{s1230067}59: ls
sshsv1{s1230067}60: Write failed: Broken pipe
jumpei-no-MacBook-Air:~ jumpeiokawara$ ssh s1230067@sshgate.u-aizu.ac.jp
PAM Authentication
Password: 
Last login: Thu Jun 09 2016 13:37:10 +0900 from p15134-ipngn110
Oracle Corporation     SunOS 5.11      11.3    February 2016

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Please log in to one of the hosts listed below.

- Solaris11: 
  - Computer Exercise Room 1 and 2  ... stdrsv1121 - stdrsv1125
  - Computer Exercise Room 3 and 4  ... std34rsv1 - std34rsv5
  - Hardware Workshop 1, 2, 3 and 4 ... stdrsv2121 - stdrsv2128
  - CALL Lab 1 and 2                ... stdrsv3121 - stdrsv3123
  - Faculty room                    ... prorsv1 - prorsv10
- OS X 10.9
  - Computer Exercise Room 5 and 6  ... std5dc2 - std5dc50, std6dc2 - std6dc50
  - iLab 1 and 2                    ... ilab1dc2 - ilab1dc49, ilab2dc2 - ilab2dc49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
sshsv1{s1230067}51: cd algo1
sshsv1{s1230067}52: cd le07
sshsv1{s1230067}53: ls
A.c  A.c~  AA.c  AA.c~  a.out  core
sshsv1{s1230067}54: rm AA.c
sshsv1{s1230067}55: more A.c
#include<stdio.h>
#define MAX 100005
#define NIL -1

struct Node
{ 
int x, y, z;
};
struct Node A1[MAX];

int num, G, A2[MAX];

int getDepth(int m){
  int b = 0;
  for(; A1[m].x != NIL ;b++) m = A1[m].x;
  return b;
}

void print(int m){
  int i, c;
  printf("node %d: ", m);
  printf("parent = %d, ", A1[m].x);
sshsv1{s1230067}56: 
sshsv1{s1230067}56: 
sshsv1{s1230067}56: 
sshsv1{s1230067}56: emacs A.c

File Edit Options Buffers Tools C Help                                          
#include<stdio.h>
#define MAX 100000
#define NIL -1

struct Node
{
int x, y, z;
};
struct Node A1[MAX];

int num, G, A2[MAX];

int getDepth(int m){
  int b = 0;
  for(; A1[m].x != NIL ;b++) m = A1[m].x;
  return b;
}

void print(int m){
  int i, c;
  printf("node %d: ", m);
  printf("parent = %d, ", A1[m].x);
  printf("depth = %d, ", A2[m]);

  if ( A1[m].x == NIL ) printf("root, ");
  else if ( A1[m].y == NIL ) printf("leaf, ");
  else printf("internal node, ");

  printf("[");
  for(i = 0, c = A1[m].y; c != NIL; i++, c = A1[c].z){
    if (i) printf(", ");
    printf("%d", c);
  }
  printf("]\n");
}

int main(){
  int i, j, a, b, c, y;
  scanf("%d", &num);
  for ( i = 0; i < num; i++ ) A1[i].x = A1[i].y = A1[i].z = NIL;

  for ( i = 0; i < num; i++ ){
    scanf("%d %d", &a, &b);
    for ( j = 0; j < b; j++ ){
      scanf("%d", &c);
      if ( j == 0 ) A1[a].y = c;
      else A1[y].z = c;
      y = c;
      A1[c].x = a;
    }
  }

  G = 0;
  for ( i = 0; i < num; i++ ){
    A2[i] = getDepth(i);
    if ( A2[i] > G ) G = A2[i];
  }

  for ( i = 0; i < num; i++ )
    {
      print(i);
    }

  return 0;
}

Compiler output:
main.c:1:1: error: expected identifier or '(' before '^' token
    1 | ^[[ALast login: Sun May 29 16:41:22 on ttys000
      | ^
main.c:2:52: error: stray '@' in program
    2 | jumpei-no-MacBook-Air:~ jumpeiokawara$ ssh s1230067@sshgate.u-aizu.ac.jp
      |                                                    ^
main.c:5:29: error: invalid digit "8" in octal constant
    5 | Last login: Wed Jun 01 2016 08:05:49 +0900 from p7215-ipngn1101
      |                             ^~
main.c:5:39: error: invalid digit "9" in octal constant
    5 | Last login: Wed Jun 01 2016 08:05:49 +0900 from p7215-ipngn1101
      |                                       ^~~~
main.c:21:17: error: expected identifier or '(' before numeric constant
   21 | sshsv1{s1230067}51:
      |                 ^~
main.c:24:17: error: expected identifier or '(' before numeric constant
   24 | sshsv1{s1230067}51: cd 2016_1
      |                 ^~
main.c:24:24: error: invalid suffix "_1" on integer constant
   24 | sshsv1{s1230067}51: cd 2016_1
      |                        ^~~~~~
main.c:25:17: error: expected identifier or '(' before numeric constant
   25 | sshsv1{s1230067}52: cd Exercises
      |                 ^~
main.c:26:17: error: expected identifier or '(' before numeric constant
   26 | sshsv1{s1230067}53: cd Java
      |                 ^~
main.c:27:17: error: expected identifier or '(' before numeric constant
   27 | sshsv1{s1230067}54: ls -l
      |                 ^~
main.c:44:17: error: expected identifier or '(' before numeric constant
   44 | sshsv1{s1230067}55: cd Ex6
      |                 ^~
main.c:45:17: error: expected identifier or '(' before numeric constant
   45 | sshsv1{s1230067}56: ls
      |                 ^~
main.c:51:17: error: expected identifier or '(' before numeric constant
   51 | sshsv1{s1230067}57: cd ..
      |                 ^~
main.c:52:17: error: expected identifier or '(' before numeric constant
   52 | sshsv1{s1230067}58: cd Ex7
      |                 ^~
main.c:53:17: error: expected identifier or '(' before numeric constant
   53 | sshsv1{s1230067}59: ls
      |                 ^~
main.c:54:17: error: expected identifier or '(' before numeric constant
   54 | sshsv1{s1230067}60: Write failed: Broken pipe
      |                 ^~
main.c:55:52: error: stray '@' in program
   55 | jumpei-no-MacBook-Air:~ jumpeiokawara$ ssh s1230067@sshgate.u-aizu.ac.jp
      |                                                    ^
main.c:58:21: error: invalid digit "9" in octal constant
   58 | Last login: Thu Jun 09 2016 13:37:10 +0900 from p15134-ipngn110
      |                     ^~
main.c:58:39: error: invalid digit "9" in octal constant
   58 | Last login: Thu Jun 09 2016 13:37:10 +0900 from p15134-ipngn110
      |                                       ^~~~
main.c:74:17: error: expected identifier or '(' before numeric constant
   74 | sshsv1{s1230067}51: cd algo1
      |                 ^~
main.c:75:17: error: expected identifier or '(' before numeric constant
   75 | sshsv1{s1230067}52: cd le07
      |                 ^~
main.c:76:17: error: expected identifier or '(' before numeric constant
   76 | sshsv1{s1230067}53: ls
      |                 ^~
main.c:78:17: error: expected identifier or '(' before numeric constant
   78 | sshsv1{s1230067}54: rm AA.c
      |                 ^~
main.c:79:17: error: expected identifier or '(' before numeric constant
   79 | sshsv1{s1230067}55: more A.c
      |                 ^~
In file included from /usr/include/stdio.h:47,
                 from main.c:80:
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:28:43: error: unknown type name 'size_t'
   28 |                                           size_t __nbytes);
      |                                           ^~~~~~
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:1:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
  +++ |+#include <stddef.h>
    1 | /* Copyright (C) 1991-2025 Free Software Foundation, Inc.
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:37:44: error: unknown type name 'size_t'
   37 |                                            size_t __nbytes);
      |                                            ^~~~~~
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:37:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:57:3: error: unknown type name 'cookie_read_function_t'; did you mean 'cookie_seek_function_t'?
   57 |   cookie_read_function_t *read;         /* Read bytes.  */
      |   ^~~~~~~~~~~~~~~~~~~~~~
      |   cookie_seek_function_t
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:58:3: error: unknown type name 'cookie_write_function_t'; did you mean 'cookie_close_function_t'?
   58 |   cookie_write_function_t *write;       /* Write bytes.  */
      |   ^~~~~~~~~~~~~~~~~~~~~~~
      |   cookie_close_function_t
/usr/include/stdio.h:314:35: error: unknown type name 'size_t'
  314 | extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
      |                                   ^~~~~~
/usr/include/stdio.h:130:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
  129 | #include <bits/stdio_lim.h>
  +++ |+#include <stddef.h>
  130 | 
/usr/include/stdio.h:320:47: error: unknown type name 'size_t'
  320 | extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __THROW
      |                                               ^~~~~~
/usr/include/stdio.h:320:47: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:340:34: error: unknown type name 'size_t'
  340 |                     int __modes, size_t __n) __THROW __nonnull ((1));
      |                                  ^~~~~~
/usr/include/stdio.h:340:34: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:346:24: error: unknown type name 'size_t'
  346 |                        size_t __size) __THROW __nonnull ((1));
      |                        ^~~~~~
/usr/include/stdio.h:346:24: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:385:44: error: unknown type name 'size_t'
  385 | extern int snprintf (char *__restrict __s, size_t __maxlen,
      |                                            ^~~~~~
/usr/include/stdio.h:385:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:389:45: error: unknown type name 'size_t'
  389 | extern int vsnprintf (char *__restrict __s, size_t __maxlen,
      |                                             ^~~~~~
/usr/include/stdio.h:389:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:690:30: error: unknown type name 'size_t'
  690 |                              size_t *__restrict __n, int __delimiter,
      |                              ^~~~~~
/usr/include/stdio.h:690:30: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:693:28: error: unknown type name 'size_t'
  693 |                            size_t *__restrict __n, int __delimiter,
      |                            ^~~~~~
/usr/include/stdio.h:693:28: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:698:27: error: unknown type name 'size_t'
  698 |                           size_t *__restrict __n,
      |                           ^~~~~~
/usr/include/stdio.h:698:27: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:728:8: error: unknown type name 'size_t'
  728 | extern size_t fread (void *__restrict __ptr, size_t __size,
      |        ^~~~~~
/usr/include/stdio.h:728:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:728:46: error: unknown type name 'size_t'
  728 | extern size_t fread (void *__restrict __ptr, size_t __size,
      |                                              ^~~~~~
/usr/include/stdio.h:728:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:729:22: error: unknown type name 'size_t'
  729 |                      size_t __n, FILE *__restrict __stream) __wur
      |                      ^~~~~~
/usr/include/stdio.h:729:22: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:735:8: error: unknown type name 'size_t'
  735 | extern size_t fwrite (const void *__restrict __ptr, size_t __size,
      |        ^~~~~~
/usr/include/stdio.h:735:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:735:53: error: unknown type name 'size_t'
  735 | extern size_t fwrite (const void *__restrict __ptr, size_t __size,
      |                                                     ^~~~~~
/usr/include/stdio.h:735:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:736:23: error: unknown type name 'size_t'
  736 |                       size_t __n, FILE *__restrict __s) __nonnull((4));
      |                       ^~~~~~
/usr/include/stdio.h:736:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:756:8: error: unknown type name 'size_t'
  756 | extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
      |        ^~~~~~
/usr/include/stdio.h:756:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:756:55: error: unknown type