blob: 72a1ee96d913c09bfa3566e9f7bfef9d54e29341 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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;
}
}
}
|