summaryrefslogtreecommitdiffstats
path: root/šola/p2/dn/DN07b_63230317.c
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2024-06-01 23:00:49 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2024-06-01 23:00:49 +0200
commit178253be0ada30420f39720e7e0fa4ee4058bce0 (patch)
treedb6d574d5945c468fccb0d39250762c41b53c7f0 /šola/p2/dn/DN07b_63230317.c
parentearhorn_m3u (diff)
downloadr-178253be0ada30420f39720e7e0fa4ee4058bce0.tar
r-178253be0ada30420f39720e7e0fa4ee4058bce0.tar.gz
r-178253be0ada30420f39720e7e0fa4ee4058bce0.tar.bz2
r-178253be0ada30420f39720e7e0fa4ee4058bce0.tar.lz
r-178253be0ada30420f39720e7e0fa4ee4058bce0.tar.xz
r-178253be0ada30420f39720e7e0fa4ee4058bce0.tar.zst
r-178253be0ada30420f39720e7e0fa4ee4058bce0.zip
Diffstat (limited to '')
-rw-r--r--šola/p2/dn/DN07b_63230317.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/šola/p2/dn/DN07b_63230317.c b/šola/p2/dn/DN07b_63230317.c
new file mode 100644
index 0000000..72a1ee9
--- /dev/null
+++ b/šola/p2/dn/DN07b_63230317.c
@@ -0,0 +1,24 @@
+#include <stdio.h>
+#include <stdbool.h>
+#include <string.h>
+int main (void) {
+ int n = 0;
+ scanf("%d\n", &n);
+ char nizi[n][43];
+ int offseti[n];
+ memset(offseti, 0, n*sizeof offseti[0]);
+ for (int i = 0; i < n; i++)
+ gets(nizi[i]); // izziv je v domačih nalogah pisat čim bolj nevarno a vseeno standardno C kodo
+ while (true) {
+ for (int i = 0; i < n; i++)
+ putchar(nizi[i][offseti[i]]);
+ putchar('\n');
+ offseti[n-1]++;
+ for (int i = n-1; !nizi[i][offseti[i]]; i--) {
+ offseti[i] = 0;
+ offseti[i-1]++;
+ if (!i)
+ return 0;
+ }
+ }
+}