classfity algorithm write by c++