Write a function called check triangle