Update triangle.cpp