From fe9f8b1bdde07a564e9097e4b2bb433634690983 Mon Sep 17 00:00:00 2001 From: sijanec Date: Thu, 11 Feb 2021 18:01:40 +0100 Subject: kar sram me je tole v git objavit tbh --- inf/zotks/1/a.out | Bin 0 -> 16880 bytes inf/zotks/1/prog.c | 27 +++++++++++++++++++ inf/zotks/2/1 | Bin 0 -> 17064 bytes inf/zotks/2/2 | Bin 0 -> 16992 bytes inf/zotks/2/Sosedska_stevila.c | 60 +++++++++++++++++++++++++++++++++++++++++ inf/zotks/2/a.out | Bin 0 -> 17064 bytes inf/zotks/2/sn2.c | 28 +++++++++++++++++++ "inf/zotks/2/\305\276" | 20 ++++++++++++++ inf/zotks/3/a.out | Bin 0 -> 17056 bytes inf/zotks/3/prog.c | 49 +++++++++++++++++++++++++++++++++ nem/delo/1002/dokument.md | 34 +++++++++++++++++++++++ 11 files changed, 218 insertions(+) create mode 100755 inf/zotks/1/a.out create mode 100644 inf/zotks/1/prog.c create mode 100755 inf/zotks/2/1 create mode 100755 inf/zotks/2/2 create mode 100644 inf/zotks/2/Sosedska_stevila.c create mode 100755 inf/zotks/2/a.out create mode 100644 inf/zotks/2/sn2.c create mode 100644 "inf/zotks/2/\305\276" create mode 100755 inf/zotks/3/a.out create mode 100644 inf/zotks/3/prog.c create mode 100644 nem/delo/1002/dokument.md diff --git a/inf/zotks/1/a.out b/inf/zotks/1/a.out new file mode 100755 index 0000000..ae0b0b9 Binary files /dev/null and b/inf/zotks/1/a.out differ diff --git a/inf/zotks/1/prog.c b/inf/zotks/1/prog.c new file mode 100644 index 0000000..f3e38f6 --- /dev/null +++ b/inf/zotks/1/prog.c @@ -0,0 +1,27 @@ +#include +#include +#include + +size_t veriga (size_t n, size_t s) { + for (size_t i = 2; i <= n; i++) { + if (n % i != 0) + return veriga(i, s+1); + } + return s; +} + +int main (int argc, char ** argv) { + size_t i; + char in[128]; + fgets(in, 127, stdin); + char * p; + size_t a = strtoll(in, &p, 10); + size_t b = strtoll(p, NULL, 10); + size_t sum = 0; + /* fprintf(stderr, "%lu, %lu\n", a, b); */ + for (size_t x = a; x <= b; x++) { + sum += veriga(x, 1); + } + fprintf(stdout, "%lu\n", sum); + return 0; +} diff --git a/inf/zotks/2/1 b/inf/zotks/2/1 new file mode 100755 index 0000000..27f5015 Binary files /dev/null and b/inf/zotks/2/1 differ diff --git a/inf/zotks/2/2 b/inf/zotks/2/2 new file mode 100755 index 0000000..f3c96af Binary files /dev/null and b/inf/zotks/2/2 differ diff --git a/inf/zotks/2/Sosedska_stevila.c b/inf/zotks/2/Sosedska_stevila.c new file mode 100644 index 0000000..eb06702 --- /dev/null +++ b/inf/zotks/2/Sosedska_stevila.c @@ -0,0 +1,60 @@ +#include +#include +#include +int popravi(char * b) { + int i = 0; + int spremenil = 0; + for (i = strlen(b)-1; i > 0; i--) { + if (b[i] > '9') { + b[i] = '0'; + b[i-1]++; + spremenil++; + } + } + if (b[0] > '9') { + /* fprintf(stderr, "debug\n");; */ + memcpy(b+1, b, 24); + b[1] = '0'; + b[0] = '1'; + spremenil++; + } + return spremenil; +} +int jeok (char * b) { + int se_enkrat = 0; + for (int i = 0; b[i+1] != '\0'; i++) { + if (b[i] == b[i+1]) { + b[i+2]++; + if (popravi(b)) + se_enkrat++; + } + } + if (se_enkrat) + return jeok(b); + return 0; +} +int main (int argc, char ** argv) { + char b[25]; /* vemo, kako veliko je št */ + char c = fgetc(stdin); + unsigned long long int i = 0; + while (!feof(stdin)) { + b[i++] = c; + c = fgetc(stdin); + } + b[i--] = '\0'; + fprintf(stderr, "poganjam %s\n", b); + fflush(stderr); + b[i]++; + popravi(b); + jeok(b); + fprintf(stdout, "%s\n", b); + return 0; +} +/* + int main (int argc, char ** argv) { + char c[1234]; + strcpy(c, argv[1]); + popravi(c); + fprintf(stdout, "%s\n", c); + } +*/ diff --git a/inf/zotks/2/a.out b/inf/zotks/2/a.out new file mode 100755 index 0000000..4853087 Binary files /dev/null and b/inf/zotks/2/a.out differ diff --git a/inf/zotks/2/sn2.c b/inf/zotks/2/sn2.c new file mode 100644 index 0000000..d919a95 --- /dev/null +++ b/inf/zotks/2/sn2.c @@ -0,0 +1,28 @@ +#include +#include +#include +#include +int main (int argc, char ** argv) { + /* bom pa tko, če nisem sposoben */ + /* NEVER EVER DO THIS */ + char c[128]; + char *p = fgets(c, 128, stdin); + p++; + unsigned long long int i = strtoll(c, NULL, 10); + i++; + int cast = 0; +label: + sprintf(c, "%llu", i); + int k = strlen(c); + for (int j = 0; j < k; j++) { + if (c[j] == c[j+1]) { + i += pow(10, k-(j+2)); + fprintf(stderr, "cd: %llu\n", i); + // cast = pow(10, k-(j+2)); + // i -= i % cast; + goto label; + } + } + fprintf(stdout, "%llu\n", i); + return 0; +} diff --git "a/inf/zotks/2/\305\276" "b/inf/zotks/2/\305\276" new file mode 100644 index 0000000..c7f947a --- /dev/null +++ "b/inf/zotks/2/\305\276" @@ -0,0 +1,20 @@ +#include +#include +int main (int argc, char ** argv) { + /* bom pa tko, če nisem sposoben */ + /* NEVER EVER DO THIS */ + char c[128]; + fgets(stdin, c); + unsigned long long int i = strtoll(c, NULL, 10); +label: + sprintf(c, "%llu\0", i); + int k = strlen(c); + for (int j = 0; j < k; j) { + if (c[j] == c[j+1]) { + i + pow(10, k-(j+1)); + goto label; + } + } + fprintf(stdout, "%llu\n", i); + return 0; +} diff --git a/inf/zotks/3/a.out b/inf/zotks/3/a.out new file mode 100755 index 0000000..2b99105 Binary files /dev/null and b/inf/zotks/3/a.out differ diff --git a/inf/zotks/3/prog.c b/inf/zotks/3/prog.c new file mode 100644 index 0000000..4b6b551 --- /dev/null +++ b/inf/zotks/3/prog.c @@ -0,0 +1,49 @@ +#include +#include +#include +int main (int argc, char ** argv) { + size_t k[200000]; + char b[2000000]; + size_t d = 0; + char * p = NULL; + char ne[128]; + char * nu = fgets(ne, 127, stdin); + nu++; nu--; + size_t n = strtoll(ne, NULL, 10); + char c = fgetc(stdin); + while (!feof(stdin)) { + b[d++] = c; + c = fgetc(stdin); + } + if (b[d-1] == '\n') /* ce je input slucajno koncan z EOL */ + d--; + if (b[d-1] == '\r') /* ce se slucajno uporablja slab operacijski sistem */ + d--; + b[d] = '\0'; + d = 0; + p = b; + do { + k[d] = strtol(p, &p, 10); + p++; /* sizeof(char) je itak 1 */ + d++; + } while (p[-1] != '\0'); + d; + size_t korakov = 0; + size_t temp = 0; + for (long int zz = 0; zz < d; zz++) { + /* fprintf(stderr, "%lu %lu %lu %lu %lu\n", k[0], k[1], k[2], k[3], k[4]); */ + if (k[zz] == zz+1) { + korakov++; + temp = k[0]; + memcpy(&(k[0]), &(k[1]), sizeof(size_t)*(d-1)); + k[d-1] = temp; + zz = -1; + } + if (korakov >= d) { + fprintf(stdout, "-1\n"); + return 0; + } + } + fprintf(stdout, "%lu\n", korakov); + return 0; +} diff --git a/nem/delo/1002/dokument.md b/nem/delo/1002/dokument.md new file mode 100644 index 0000000..ca846cd --- /dev/null +++ b/nem/delo/1002/dokument.md @@ -0,0 +1,34 @@ +* Becherstapeln - lončke zlagati +* Wer ist am schnellsten? - kdo je najhitrejši? +* Oliver sammelt Becher, er macht Sport. +* die Meisterschaft (-ten) - prvenstvo +* Wir waren dabei - mi smo bili zreven. +* Komma - vejica +* der Wettbewerb (-e) - tekmovanje. +* zur Meisterschaft kommen - priti na prvenstvo. +* der Vorteil (-e) - prednost +* der Nachteil (-e) - slabost +* merken - zapomniti si +* schaffen - uspeti. +* beliebter - bolj priljubljen (ne ~~mehr beliebt~~) +* am höchsten +* besser als +* schneller +* am schnellsten von allen +* genauso schnell wie +* mehr +* bekannter +* mehr +* mehr als +* besser +* leichter +* fitter +* leichter +* was ist becher +* was macht er +* wie gut ist er +* was ist wichtig +* wie war seine zeit heute +* wer hat diese sportart nach deutschland gebracht + +# DN: 10 vprašanj o tekstu K:/28 -- cgit v1.2.3