Update triplet.cpp