diff options
Diffstat (limited to 'šola/p2/dn/DN06a_63230317.c')
-rw-r--r-- | šola/p2/dn/DN06a_63230317.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/šola/p2/dn/DN06a_63230317.c b/šola/p2/dn/DN06a_63230317.c new file mode 100644 index 0000000..a57b548 --- /dev/null +++ b/šola/p2/dn/DN06a_63230317.c @@ -0,0 +1,18 @@ +#include <stdio.h> +int globina (int * a, int * b) { + int globina[2]; + if (*a) + globina[0] = globina(a+*a, b); + if (*b) + globina[1] = globina(a, b+*b); + +} +int main (void) { + int n; + scanf("%d\n", &n); + int a[n]; + int b[n]; + for (int i = 0; i < n; i++) + scanf("%d %d\n", &a[i], &b[i]); + printf("%d\n", globina(a, b)); +} |