Language: C++

#include <iostream>
using namespace std;

struct Card{ char suit; value;} ;

void bubbleSort(struct Card C[],int N){
  int i,j;
  for(i=0;i<N;i++){
    for(j=N-1;j<=i+1;j--){
      if(C[j].value<C[j-1].value){
        Card t=C[j];
        C[j]=C[j-1];
        C[j-1]=t;
      }
    }
  }
}

void selecitonSort(struct Card C[],int N){
  int i,j,minj;
  struct Card t;
  for(i=0;i<N;i++){
    minj=i;
    for(j=i;j<N;j++){
      if(C[j].value<C[minj].value)minj=j;
    }
    Card t=C[i];
    C[i]=C[minj];
    C[minj]=t;
  }
}

int hantei(struct Card C0[],struct Card C[],int N){
  int i,j;
  for(i=0;i<N-1;i++){
    if(C[i].value==C[i+1].value){
      for(j=0;j<N-1;j++){
        if(C[i].value==C0[j].value)
          if(C[i].suit==C0[j].suit&&C[i+1].suit==C0[j+1].suit)return 1;
      }
    }  
  }
  return 0;
}

void syutryoku(struct Card C[],int N){
  int i;
  for(i=0;i<N;i++){
    if(i>0)printf(" ");
    cout << C[i].suit << C[i].value;
  }
  cout << endl;
}
int main(){
  struct Card C0[100],C1[100],C2[100];
  int N,i;

  cin >> N

  for(i=0;i<N;i++){
    cin >> C0[i].suit >> C0[i].value
  }
  for(i=0;i<N;i++){
    C1[i]=C0[i];
    C2[i]=C0[i];
  }

  bubbleSort(C1,N);
  selecitonSort(C2,N);

  syutryoku(C1,N);
  if(hantei(C0,C1,N))cin>>"Stable">>endl;
  else cin>>"Not stable">>endl;

  syutryoku(C2,N);
  if(hantei(C0,C2,N))cin>>"Stable">>endl;
  else cin>>"Not stable">>endl;
  
  return 0;
}



Compiler output:
a.cc:4:25: error: 'value' does not name a type
    4 | struct Card{ char suit; value;} ;
      |                         ^~~~~
a.cc: In function 'void bubbleSort(Card*, int)':
a.cc:10:15: error: 'struct Card' has no member named 'value'
   10 |       if(C[j].value<C[j-1].value){
      |               ^~~~~
a.cc:10:28: error: 'struct Card' has no member named 'value'
   10 |       if(C[j].value<C[j-1].value){
      |                            ^~~~~
a.cc: In function 'void selecitonSort(Card*, int)':
a.cc:25:15: error: 'struct Card' has no member named 'value'
   25 |       if(C[j].value<C[minj].value)minj=j;
      |               ^~~~~
a.cc:25:29: error: 'struct Card' has no member named 'value'
   25 |       if(C[j].value<C[minj].value)minj=j;
      |                             ^~~~~
a.cc: In function 'int hantei(Card*, Card*, int)':
a.cc:36:13: error: 'struct Card' has no member named 'value'
   36 |     if(C[i].value==C[i+1].value){
      |             ^~~~~
a.cc:36:27: error: 'struct Card' has no member named 'value'
   36 |     if(C[i].value==C[i+1].value){
      |                           ^~~~~
a.cc:38:17: error: 'struct Card' has no member named 'value'
   38 |         if(C[i].value==C0[j].value)
      |                 ^~~~~
a.cc:38:30: error: 'struct Card' has no member named 'value'
   38 |         if(C[i].value==C0[j].value)
      |                              ^~~~~
a.cc: In function 'void syutryoku(Card*, int)':
a.cc:50:31: error: 'struct Card' has no member named 'value'
   50 |     cout << C[i].suit << C[i].value;
      |                               ^~~~~
a.cc: In function 'int main()':
a.cc:58:11: error: expected ';' before 'for'
   58 |   cin >> N
      |           ^
      |           ;
   59 | 
   60 |   for(i=0;i<N;i++){
      |   ~~~      
a.cc:60:18: error: expected ';' before ')' token
   60 |   for(i=0;i<N;i++){
      |                  ^
      |                  ;
a.cc:72:25: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'const char [7]')
   72 |   if(hantei(C0,C1,N))cin>>"Stable">>endl;
      |                      ~~~^~~~~~~~~~
      |                      |    |
      |                      |    const char [7]
      |                      std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
                 from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  170 |       operator>>(bool& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:170:7: note:   conversion of argument 1 would be ill-formed:
a.cc:72:27: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'const char*'
   72 |   if(hantei(C0,C1,N))cin>>"Stable">>endl;
      |                           ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
  174 |       operator>>(short& __n);
      |       ^~~~~~~~
/usr/include/c++/14/istream:174:7: note:   conversion of argument 1 would be ill-formed:
a.cc:72:27: error: invalid conversion from 'const char*' to 'short int' [-fpermissive]
   72 |   if(hantei(C0,C1,N))cin>>"Stable">>endl;
      |                           ^~~~~~~~
      |                           |
      |                           const char*
a.cc:72:27: error: cannot bind rvalue '(short int)((const char*)"Stable")' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  177 |       operator>>(unsigned short& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:177:7: note:   conversion of argument 1 would be ill-formed:
a.cc:72:27: error: invalid conversion from 'const char*' to 'short unsigned int' [-fpermissive]
   72 |   if(hantei(C0,C1,N))cin>>"Stable">>endl;
      |                           ^~~~~~~~
      |                           |
      |                           const char*
a.cc:72:27: error: cannot bind rvalue '(short unsigned int)((const char*)"Stable")' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
  181 |       operator>>(int& __n);
      |       ^~~~~~~~
/usr/include/c++/14/istream:181:7: note:   conversion of argument 1 would be ill-formed:
a.cc:72:27: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   72 |   if(hantei(C0,C1,N))cin>>"Stable">>endl;
      |                           ^~~~~~~~
      |                           |
      |                           const char*
a.cc:72:27: error: cannot bind rvalue '(int)((const char*)"Stable")' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  184 |       operator>>(unsigned int& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:184:7: note:   conversion of argument 1 would be ill-formed:
a.cc:72:27: error: invalid conversion from 'const char*' to 'unsigned int' [-fpermissive]
   72 |   if(hantei(C0,C1,N))cin>>"Stable">>endl;
      |                           ^~~~~~~~
      |                           |
      |                           const char*
a.cc:72:27: error: cannot bind rvalue '(unsigned int)((const char*)"Stable")' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  188 |       operator>>(long& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:188:7: note:   conversion of argument 1 would be ill-formed:
a.cc:72:27: error: invalid conversion from 'const char*' to 'long int' [-fpermissive]
   72 |   if(hantei(C0,C1,N))cin>>"Stable">>endl;
      |                           ^~~~~~~~
      |                           |
      |                           const char*
a.cc:72:27: error: cannot bind rvalue '(long int)((const char*)"Stable")' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  192 |       operator>>(unsigned long& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:192:7: note:   conversion of argument 1 would be ill-formed:
a.cc:72:27: error: invalid conversion from 'const char*' to 'long unsigned int' [-fpermissive]
   72 |   if(hantei(C0,C1,N))cin>>"Stable">>endl;
      |                           ^~~~~~~~
      |                           |
      |                           const char*
a.cc:72:27: error: cannot bind rvalue '(long unsigned int)((const char*)"Stable")' to 'long unsigned int&'
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  199 |       operator>>(long long& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:199:7: note:   conversion of argument 1 would be ill-formed:
a.cc:72:27: error: invalid conversion from 'const char*' to 'long long int' [-fpermissive]
   72 |   if(hantei(C0,C1,N))cin>>"Stable">>endl;
      |                           ^~~~~~~~
      |                           |
      |                           const char*
a.cc:72:27: error: cannot bind rvalue '(long long int)((const char*)"Stable")' to 'long long int&'
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  203 |       operator>>(unsigned long long& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:203:7: note:   conversion of argument 1 would be ill-formed:
a.cc:72:27: error: invalid conversion from 'const char*' to 'long long unsigned int' [-fpermissive]
   72 |   if(hantei(C0,C1,N))cin>>"Stable">>endl;
      |                           ^~~~~~~~
      |                           |
      |                           const char*
a.cc:72:27: error: cannot bind rvalue '(long long unsigned int)((const char*)"Stable")' to 'long long unsigned int&'
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  328 |       operator>>(void*& __p)
      |       ^~~~~~~~
/usr/include/c++/14/istream:328:7: note:   conversion of argument 1 would be ill-formed:
a.cc:72:27: error: invalid conversion from 'const void*' to 'void*' [-fpermissive]
   72 |   if(hantei(C0,C1,N))cin>>"Stable">>endl;
      |                           ^~~~~~~~
      |                           |
      |                           const void*
a.cc:72:27: error: cannot bind rvalue '(void*)((const void*)((const char*)"Stable"))' to 'void*&'
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [w