summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2024-03-31 14:54:47 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2024-03-31 14:54:47 +0200
commit677bbaf1173953eaa34d91b6d4249d4a4aa47930 (patch)
treec7e971e103c85f76d0ab1b90cfcfd2fd2024e0e6
parent365-error-fix (diff)
downloadr-677bbaf1173953eaa34d91b6d4249d4a4aa47930.tar
r-677bbaf1173953eaa34d91b6d4249d4a4aa47930.tar.gz
r-677bbaf1173953eaa34d91b6d4249d4a4aa47930.tar.bz2
r-677bbaf1173953eaa34d91b6d4249d4a4aa47930.tar.lz
r-677bbaf1173953eaa34d91b6d4249d4a4aa47930.tar.xz
r-677bbaf1173953eaa34d91b6d4249d4a4aa47930.tar.zst
r-677bbaf1173953eaa34d91b6d4249d4a4aa47930.zip
-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