]> web.ist.utl.pt Git - iaed.git/commitdiff
Adding ex1
authorAlexandre P Francisco <aplf@ist.utl.pt>
Mon, 10 Mar 2014 23:04:41 +0000 (23:04 +0000)
committerAlexandre P Francisco <aplf@ist.utl.pt>
Mon, 10 Mar 2014 23:04:41 +0000 (23:04 +0000)
aula02/ex1.c [new file with mode: 0644]

diff --git a/aula02/ex1.c b/aula02/ex1.c
new file mode 100644 (file)
index 0000000..f4f1e89
--- /dev/null
@@ -0,0 +1,20 @@
+#include <stdio.h>
+
+int maior(int, int, int);
+
+int main() {
+  int a, b, c;
+
+  scanf("%d%d%d", &a, &b, &c);
+  printf("max: %d\n", maior(a, b, c));
+
+  return 0;
+}
+
+int maior(int a, int b, int c) {
+  if (a < b) a = b;
+  if (a < c) a = c;
+
+  return a;
+}
+