Language: C++

Last login: Mon Nov 21 13:34:48 on ttys001
wakabayashirika-no-MacBook-Pro:~ wakabayashirika$ pwd
/Users/wakabayashirika
wakabayashirika-no-MacBook-Pro:~ wakabayashirika$ ls
Desktop		Library		Pictures	play
Documents	Movies		Public		rippro
Downloads	Music		class
wakabayashirika-no-MacBook-Pro:~ wakabayashirika$ cd Desktop
wakabayashirika-no-MacBook-Pro:Desktop wakabayashirika$ ls
rippro
wakabayashirika-no-MacBook-Pro:Desktop wakabayashirika$ mkdir class
wakabayashirika-no-MacBook-Pro:Desktop wakabayashirika$ ls
class	rippro
wakabayashirika-no-MacBook-Pro:Desktop wakabayashirika$ cd clas
-bash: cd: clas: No such file or directory
wakabayashirika-no-MacBook-Pro:Desktop wakabayashirika$ cd class
wakabayashirika-no-MacBook-Pro:class wakabayashirika$ mkdir w9
wakabayashirika-no-MacBook-Pro:class wakabayashirika$ ls
w9
wakabayashirika-no-MacBook-Pro:class wakabayashirika$ cd w9
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ ls
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ emacs numbers.dat
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ ls
numbers.dat
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ emacs class9-1.c
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ gcc -o class9-1 class9-1.c
class9-1.c:19:16: warning: incompatible pointer types passing 'char [3]' to
      parameter of type 'FILE *' (aka 'struct __sFILE *')
      [-Wincompatible-pointer-types]
  while(fscanf("%d",&a)!=EOF){
               ^~~~
/usr/include/stdio.h:250:30: note: passing argument to parameter here
int      fscanf(FILE * __restrict, const char * __restrict, ...) __scanf...
                                 ^
class9-1.c:19:21: warning: incompatible pointer types passing 'int *' to
      parameter of type 'const char *' [-Wincompatible-pointer-types]
  while(fscanf("%d",&a)!=EOF){
                    ^~
/usr/include/stdio.h:250:55: note: passing argument to parameter here
int      fscanf(FILE * __restrict, const char * __restrict, ...) __scanf...
                                                          ^
class9-1.c:19:21: warning: format string is not a string literal
      (potentially insecure) [-Wformat-security]
  while(fscanf("%d",&a)!=EOF){
                    ^~
class9-1.c:22:9: error: use of undeclared identifier 'j'
    for(j=n;j>i;j--)
        ^
class9-1.c:22:13: error: use of undeclared identifier 'j'
    for(j=n;j>i;j--)
            ^
class9-1.c:22:17: error: use of undeclared identifier 'j'
    for(j=n;j>i;j--)
                ^
class9-1.c:23:12: error: use of undeclared identifier 'j'
      sort[j+1]=sort[j];//slide
           ^
class9-1.c:23:22: error: use of undeclared identifier 'j'
      sort[j+1]=sort[j];//slide
                     ^
3 warnings and 5 errors generated.
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ emacs class9-1.c
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ gcc -o class9-1 class9-1.c
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ ./class9-1
1
0
0
0
13
0
0
0
15
0
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ emacs class9-1.c
xwakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ gcc -o class9-1 class9-1.c
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ ./class9-1
a=91
a=63
sort[0]=91
a=71
sort[0]=63
sort[1]=0
a=14
sort[0]=63
a=60
sort[0]=14
sort[1]=0
sort[2]=0
sort[3]=71
a=1
sort[0]=14
a=24
sort[0]=1
sort[1]=0
sort[2]=0
sort[3]=0
sort[4]=60
a=13
sort[0]=1
sort[1]=0
sort[2]=0
sort[3]=0
sort[4]=24
a=80
sort[0]=1
sort[1]=0
sort[2]=0
sort[3]=0
sort[4]=13
sort[5]=0
sort[6]=0
sort[7]=0
a=15
sort[0]=1
sort[1]=0
sort[2]=0
sort[3]=0
sort[4]=13
sort[5]=0
sort[6]=0
sort[7]=0
sort[8]=80
1
0
0
0
13
0
0
0
15
0
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ emacs class9-1.c
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ gcc -o class9-1 class9-1.c
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ ./class9-1
a=91
a=63
sort[0]=91
a=71
sort[0]=63
sort[1]=91
a=14
sort[0]=63
a=60
sort[0]=14
sort[1]=63
a=1
sort[0]=14
a=24
sort[0]=1
sort[1]=14
sort[2]=60
a=13
sort[0]=1
sort[1]=14
a=80
sort[0]=1
sort[1]=13
sort[2]=14
sort[3]=24
sort[4]=60
sort[5]=63
sort[6]=71
sort[7]=91
a=15
sort[0]=1
sort[1]=13
sort[2]=14
sort[3]=24
1
13
14
15
24
60
63
71
80
91
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ emacs class9-1.c
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ gcc -o class9-1 class9-1.c
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ ./class9-1
1
13
14
15
24
60
63
71
80
91
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ ls
class9-1	class9-1.c~	class9-2.c	numbers.dat
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ cp class9-2.c class9-1.c
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ emacs class9-1.c
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ gcc -o class9-1 class9-1.c
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ ./class9-1
1
13
14
15
24
60
63
71
80
91
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ cp class9-1.c class9-3.c
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ emacs class9-3.c
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ gcc -o class9-3 class9-3.c
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ ./class9-3
0
1
13
14
15
24
60
63
71
80
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ emacs class9-3.c
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ gcc -o class9-3 class9-3.c
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ ./class9-3
n=0
91 63 71 14 60 1 24 13 80 15 
n=1
63 71 14 60 1 24 13 80 15 0 
n=2
63 14 60 1 24 13 71 15 0 80 
n=3
14 60 1 24 13 63 15 0 71 80 
n=4
14 1 24 13 60 15 0 63 71 80 
n=5
1 14 13 24 15 0 60 63 71 80 
n=6
1 13 14 15 0 24 60 63 71 80 
n=7
1 13 14 0 15 24 60 63 71 80 
n=8
1 13 0 14 15 24 60 63 71 80 
n=9
1 0 13 14 15 24 60 63 71 80 
0
1
13
14
15
24
60
63
71
80
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ emacs class9-3.c
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ gcc -o class9-3 class9-3.c
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ ./class9-3
n=0
91 63 71 14 60 1 24 13 80 15 
n=1
63 71 14 60 1 24 13 80 15 91 
n=2
63 14 60 1 24 13 71 15 80 91 
n=3
14 60 1 24 13 63 15 71 80 91 
n=4
14 1 24 13 60 15 63 71 80 91 
n=5
1 14 13 24 15 60 63 71 80 91 
n=6
1 13 14 15 24 60 63 71 80 91 
n=7
1 13 14 15 24 60 63 71 80 91 
n=8
1 13 14 15 24 60 63 71 80 91 
n=9
1 13 14 15 24 60 63 71 80 91 
1
13
14
15
24
60
63
71
80
91
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ emacs class9-3.c
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ gcc -o class9-3 class9-3.c
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ ./class9-3
1
13
14
15
24
60
63
71
80
91
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ ls
class9-1	class9-1.c~	class9-3	numbers.dat
class9-1.c	class9-2.c	class9-3.c~	opt9-3.c
wakabayashirika-no-MacBook-Pro:w9 wakabayashirika$ cd ..
wakabayashirika-no-MacBook-Pro:class wakabayashirika$ ls
w9
wakabayashirika-no-MacBook-Pro:class wakabayashirika$ mkdir w10
wakabayashirika-no-MacBook-Pro:class wakabayashirika$ cd w10
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ ls
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ emacs numbers.dat
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ ls
numbers.dat
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ cat numbers.dayt
cat: numbers.dayt: No such file or directory
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ 
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ cat numbers.dat
91 63 71 14 60 1 24 13 80 15wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ ls
numbers.dat
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ emacs class10-1.c
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ gcc -o class10-1.c
clang: error: no input files
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ gcc -o class10-1 class10-1.c 
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ ./class10-1 
1
13
14
60
15
71
24
91
80
63
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ cp class10-1.c class10-2.c
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ emacs class10-2.c
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ gcc -o class10-2 class10-2.c
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ ./class10-2
0
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ emacs class10-2.c
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ gcc -o class10-2 class10-2.c
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ ./class10-2
0
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ 
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ emacs class10-2.c
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ gcc -o class10-2 class10-2.c
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ ./class10-2
0
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ emacs class10-2.c
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ gcc -o class10-2 class10-2.c
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ ./class10-2
0
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ emacs class10-2.c
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ gcc -o class10-2 class10-2.c
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ ./class10-2
0
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ emacs class10-2.c
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ gcc -o class10-2 class10-2.c
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ ./class10-2
0
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ emacs class10-2.c
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ gcc -o class10-2 class10-2.c
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ ./class10-2
A
B
0
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ gcc -o class10-2 class10-2.c
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ emacs class10-2.c
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ gcc -o class10-2 class10-2.c
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ ./class10-2
A
B
0
A
B
1
A
B
2
A
B
3
A
B
4
1
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ emacs class10-2.c
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ gcc -o class10-2 class10-2.c
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ ./class10-2
1
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ cp class10-2.c class10-3.c
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ emacs class10-3.c
wakabayashirika-no-MacBook-Pro:w10 wakabayashirika$ cd ..
wakabayashirika-no-MacBook-Pro:class wakabayashirika$ ls
w10	w9
wakabayashirika-no-MacBook-Pro:class wakabayashirika$ cd ..
wakabayashirika-no-MacBook-Pro:Desktop wakabayashirika$ ls
class	rippro
wakabayashirika-no-MacBook-Pro:Desktop wakabayashirika$ cd rippro
wakabayashirika-no-MacBook-Pro:rippro wakabayashirika$ ls
rippro			rippro.xcodeproj
wakabayashirika-no-MacBook-Pro:rippro wakabayashirika$ cd rippro
wakabayashirika-no-MacBook-Pro:rippro wakabayashirika$ ls
1121	a.cpp	b.cpp	b.hpp
wakabayashirika-no-MacBook-Pro:rippro wakabayashirika$ mkdir aoj_icpc
wakabayashirika-no-MacBook-Pro:rippro wakabayashirika$ cd aoj_icpc
wakabayashirika-no-MacBook-Pro:aoj_icpc wakabayashirika$ ls
wakabayashirika-no-MacBook-Pro:aoj_icpc wakabayashirika$ mkdir 1121
wakabayashirika-no-MacBook-Pro:aoj_icpc wakabayashirika$ cd 1121
wakabayashirika-no-MacBook-Pro:1121 wakabayashirika$ ls
wakabayashirika-no-MacBook-Pro:1121 wakabayashirika$ emacs judge.c
wakabayashirika-no-MacBook-Pro:1121 wakabayashirika$ emacs judge.cpp
wakabayashirika-no-MacBook-Pro:1121 wakabayashirika$ emacs fast_division.cpp
wakabayashirika-no-MacBook-Pro:1121 wakabayashirika$ g++ -o fast_division fast_division
clang: error: no such file or directory: 'fast_division'
clang: error: no input files
wakabayashirika-no-MacBook-Pro:1121 wakabayashirika$ g++ -o fast_division fast_division.cpp
wakabayashirika-no-MacBook-Pro:1121 wakabayashirika$ ./fast_division
1
2
wakabayashirika-no-MacBook-Pro:1121 wakabayashirika$ emacs fast_division.cpp

#include <iostream>
#include <cstdio>
#include <cmath>
#include <math.h>
#include <string>
#include <string.h>
#include <stack>
#include <queue>
#include <vector>
using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 10000000000

#define rep(i,n) for(i=0,i<n,i++)
typedef pair<int,int> pii;
int i,j;

int main() {
  int n;
  cin>>n;
  if(n==0)
    cout<<"1"<<endl;
  else if(n==1)
    cout<<"2"<<endl;
  else if(n==2)
    cout<<"1"<<endl;
  else
    cout<<"0"<<endl;
  return 0;
}

Compiler output:
a.cc:27:63: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   27 | class9-1.c:19:16: warning: incompatible pointer types passing 'char [3]' to
      |                                                               ^~~~~~~~~~
a.cc:28:25: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
   28 |       parameter of type 'FILE *' (aka 'struct __sFILE *')
      |                         ^~~~~~~~
a.cc:28:39: warning: multi-character literal with 16 characters exceeds 'int' size of 4 bytes
   28 |       parameter of type 'FILE *' (aka 'struct __sFILE *')
      |                                       ^~~~~~~~~~~~~~~~~~
a.cc:35:63: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
   35 | class9-1.c:19:21: warning: incompatible pointer types passing 'int *' to
      |                                                               ^~~~~~~
a.cc:36:25: warning: multi-character literal with 12 characters exceeds 'int' size of 4 bytes
   36 |       parameter of type 'const char *' [-Wincompatible-pointer-types]
      |                         ^~~~~~~~~~~~~~
a.cc:416:42: warning: multi-character literal with 13 characters exceeds 'int' size of 4 bytes
  416 | clang: error: no such file or directory: 'fast_division'
      |                                          ^~~~~~~~~~~~~~~
a.cc:1:1: error: 'Last' does not name a type
    1 | Last login: Mon Nov 21 13:34:48 on ttys001
      | ^~~~