]> web.ist.utl.pt Git - iaed.git/commitdiff
Adding ex5
authorAlexandre P Francisco <aplf@ist.utl.pt>
Tue, 11 Mar 2014 18:55:34 +0000 (18:55 +0000)
committerAlexandre P Francisco <aplf@ist.utl.pt>
Tue, 11 Mar 2014 18:55:34 +0000 (18:55 +0000)
aula02/ex5.c [new file with mode: 0644]

diff --git a/aula02/ex5.c b/aula02/ex5.c
new file mode 100644 (file)
index 0000000..425a13d
--- /dev/null
@@ -0,0 +1,15 @@
+#include <stdio.h>
+
+#define TUNITS 60
+
+int main() {
+  int time;
+
+  scanf("%d", &time);
+  printf("%02d:%02d:%02d\n",
+      time/(TUNITS*TUNITS),
+      (time/TUNITS)%TUNITS,
+      time%TUNITS);
+
+  return 0;
+}