summaryrefslogtreecommitdiffstats
path: root/šola/p2/dn
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--šola/p2/dn/naloga1.c34
-rw-r--r--šola/p2/dn/naloga2.c36
2 files changed, 70 insertions, 0 deletions
diff --git a/šola/p2/dn/naloga1.c b/šola/p2/dn/naloga1.c
new file mode 100644
index 0000000..7938950
--- /dev/null
+++ b/šola/p2/dn/naloga1.c
@@ -0,0 +1,34 @@
+/*
+
+Prevajanje in poganjanje skupaj z datoteko test01.c:
+
+gcc -D=test test01.c naloga1.c
+./a.out
+
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "naloga1.h"
+
+int * poisci (int * t, int * dolzina, int ** konec) {
+ *konec = t;
+ while (**konec)
+ (*konec)++;
+ (*konec)--;
+ while (*t)
+ t--;
+ t++;
+ *dolzina = *konec - t + 1;
+ return t;
+}
+
+#ifndef test
+
+int main () {
+ // koda za ro"cno testiranje (po "zelji)
+ return 0;
+}
+
+#endif
diff --git a/šola/p2/dn/naloga2.c b/šola/p2/dn/naloga2.c
new file mode 100644
index 0000000..09915a6
--- /dev/null
+++ b/šola/p2/dn/naloga2.c
@@ -0,0 +1,36 @@
+/*
+
+ Prevajanje in poganjanje skupaj z datoteko test01.c:
+
+ gcc -D=test test01.c naloga2.c
+ ./a.out
+
+
+*/
+
+#include <stdio.h>
+#include "naloga2.h"
+
+void zamenjaj (int ** a, int ** b) {
+ int * tmp = *b;
+ *b = *a;
+ *a = tmp;
+}
+
+void uredi (int ** a, int ** b, int ** c) {
+ if (**a > **b)
+ zamenjaj(a, b);
+ if (**b > **c)
+ zamenjaj(b, c);
+ if (**a > **b)
+ zamenjaj(a, b);
+}
+
+#ifndef test
+
+int main() {
+ // koda za ro"cno testiranje (po "zelji)
+ return 0;
+}
+
+#endif