modify triangle.cc