about summary refs log tree commit diff
path: root/others/mHoang20150916/triangle.c
diff options
context:
space:
mode:
authorRaphael McSinyx <vn.mcsinyx@gmail.com>2016-11-20 16:01:00 +0700
committerRaphael McSinyx <vn.mcsinyx@gmail.com>2016-11-21 23:09:31 +0700
commit48dffc6138fb90c2df90207b7b3d3291f8498001 (patch)
treec7d03f0b9ca356422105a11e62cb0e4ef9dc4059 /others/mHoang20150916/triangle.c
parentf97ad3e9e225a288e7a8a53c2ef0acb45a47dbde (diff)
downloadcp-48dffc6138fb90c2df90207b7b3d3291f8498001.tar.gz
Add others/mHoang20150916
Diffstat (limited to 'others/mHoang20150916/triangle.c')
-rw-r--r--others/mHoang20150916/triangle.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/others/mHoang20150916/triangle.c b/others/mHoang20150916/triangle.c
new file mode 100644
index 0000000..0f5d28e
--- /dev/null
+++ b/others/mHoang20150916/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;
+}