three AC code in c++