From 677bbaf1173953eaa34d91b6d4249d4a4aa47930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Sun, 31 Mar 2024 14:54:47 +0200 Subject: dn05p2 --- "\305\241ola/p2/dn/naloga1.c" | 34 ++++++++++++++++++++++++++++++++++ "\305\241ola/p2/dn/naloga2.c" | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 "\305\241ola/p2/dn/naloga1.c" create mode 100644 "\305\241ola/p2/dn/naloga2.c" diff --git "a/\305\241ola/p2/dn/naloga1.c" "b/\305\241ola/p2/dn/naloga1.c" new file mode 100644 index 0000000..7938950 --- /dev/null +++ "b/\305\241ola/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 +#include + +#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/\305\241ola/p2/dn/naloga2.c" "b/\305\241ola/p2/dn/naloga2.c" new file mode 100644 index 0000000..09915a6 --- /dev/null +++ "b/\305\241ola/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 +#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 -- cgit v1.2.3