about summary refs log tree commit diff
path: root/others/mHoang/triangle.c
diff options
context:
space:
mode:
authorRaphael McSinyx <vn.mcsinyx@gmail.com>2017-01-01 20:42:05 +0700
committerRaphael McSinyx <vn.mcsinyx@gmail.com>2017-01-01 20:42:05 +0700
commitc67182c04491f2cf8b67e78b68aebf32aea25470 (patch)
treed82d7fd5478dffb1348143c67cbb330955dbf0f8 /others/mHoang/triangle.c
parent70f37066d2d368a2810a2be209ae0bd8b391293b (diff)
downloadcp-c67182c04491f2cf8b67e78b68aebf32aea25470.tar.gz
Update others/{mHoang,mkcal}
Diffstat (limited to 'others/mHoang/triangle.c')
-rw-r--r--others/mHoang/triangle.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/others/mHoang/triangle.c b/others/mHoang/triangle.c
new file mode 100644
index 0000000..0f5d28e
--- /dev/null
+++ b/others/mHoang/triangle.c
@@ -0,0 +1,19 @@
+#include <stdio.h>
+
+char angle(long x, long y, long z)
+{
+	long long tmp = x * x + y * y - z * z;
+
+	return (tmp ? (tmp > 0 ? 1 : 2) : tmp);
+}
+
+int main()
+{
+	long a, b, c;
+
+	scanf("%ld %ld %ld", &a, &b, &c);
+
+	printf("%hhd\n", angle(a, b, c) * angle(b, c, a) * angle(c, a, b));
+
+	return 0;
+}