Problem Description Link
1. if four side are equal then it is called "square".
2. if any tow pair side are equal then it is called "rectangle"
3. if each side is smaller or equal sum of other three side then it is called "quadrangle".
4. otherwise "banana"
example.
10 8 7 6 is a quadrangle because
1. 10<=(8+7+6)
2. 8<=(10+7+6)
3. 7<=(10+8+6)
4. 6<=(10+8+7)
1 1 9 9 is rectangle because two pair are equal
1. 1 == 1
2. 9 == 9
Algorithm:
This is a simple problem just follow this technique 1. if four side are equal then it is called "square".
2. if any tow pair side are equal then it is called "rectangle"
3. if each side is smaller or equal sum of other three side then it is called "quadrangle".
4. otherwise "banana"
example.
10 8 7 6 is a quadrangle because
1. 10<=(8+7+6)
2. 8<=(10+7+6)
3. 7<=(10+8+6)
4. 6<=(10+8+7)
1 1 9 9 is rectangle because two pair are equal
1. 1 == 1
2. 9 == 9
No comments:
Post a Comment
Write your comment - Share Knowledge and Experience