#include <iostream>
class Kik{
public:
mutable char *plansza;
mutable int ilosc_wypisan;
mutable int bledne_wywolania;
static int errors;
static int count;
Kik(){
(*this).plansza = new char[9];
(*this).ilosc_wypisan = 0;
(*this).bledne_wywolania = 0;
count++;
for(int i = 0; i < 9; i++){
(*this).plansza[i] = '.';
}
}
Kik(const Kik &A){
(*this).plansza = new char[9];
(*this).ilosc_wypisan = 0;
(*this).bledne_wywolania = 0;
count++;
for(int i = 0; i < 9; i++){
(*this).plansza[i] = A.plansza[i];
}
}
Kik(char A[3][3]){
(*this).plansza = new char[9];
(*this).ilosc_wypisan = 0;
(*this).bledne_wywolania = 0;
count++;
for(int i = 0; i < 3; i++){
for(int j = 0; j < 3; j++){
(*this).plansza[i * 3 + j] = A[i][j];
}
}
}
~Kik(){
errors -= (*this).bledne_wywolania;
count--;
}
Kik operator=(Kik A){
if(this == &A) return *this;
(*this).plansza = new char[9];
(*this).ilosc_wypisan = 0;
(*this).bledne_wywolania = 0;
for(int i = 0; i < 9; i++){
(*this).plansza[i] = A.plansza[i];
}
return *this;
}
void playAt(int i, int j, char k) const {
if(i >= 0 && i <= 2 && j >= 0 && j <= 2){
if(plansza[i * 3 + j] == '.' && (k == 'X' || k == 'O')){
(*this).plansza[i * 3 + j] = k;
}
else{
(*this).bledne_wywolania++;
errors++;
}
}
else{
(*this).bledne_wywolania++;
errors++;
}
}
int printNumber() const {
return (*this).ilosc_wypisan;
}
static int errorNumber(){
return errors;
}
static int objectNumber(){
return count;
}
friend std::ostream& operator<<(std::ostream &stream, const Kik &A){
A.ilosc_wypisan++;
for(int i = 0; i < 3; i ++){
for(int j = 0; j < 3; j++){
stream << A.plansza[i * 3 + j] << " ";
}
stream << std::endl;
}
return stream;
}
};
int Kik::errors = 0;
int Kik::count = 0;
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}