summaryrefslogtreecommitdiffstats
path: root/mat/advent/8/prog.c
diff options
context:
space:
mode:
Diffstat (limited to 'mat/advent/8/prog.c')
-rw-r--r--mat/advent/8/prog.c28
1 files changed, 0 insertions, 28 deletions
diff --git a/mat/advent/8/prog.c b/mat/advent/8/prog.c
deleted file mode 100644
index 172cbe0..0000000
--- a/mat/advent/8/prog.c
+++ /dev/null
@@ -1,28 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-int main (int argc, char ** argv) {
- if (argc != 1+3) {
- fprintf(stderr, "uporaba: %s <od> <do> <n>\nprimer: %s 1000 9999 8499\n", argv[0], argv[0]);
- return 1;
- }
- unsigned long long int o = strtoull(argv[1], NULL, 10);
- unsigned long long int d = strtoull(argv[2], NULL, 10);
- unsigned long long int n = strtoull(argv[3], NULL, 10);
- unsigned long long int i = o;
- unsigned long long int j = o;
- unsigned long long int s = 0;
- for (i = o; i <= d; i++) {
- fprintf(stderr, "\rpreostane še %llu iteracij", n-i);
- s = 0;
- for (j = o; j <= d; j++) {
- if (j == i)
- continue;
- s += j;
- }
- if (n * i == s)
- break;
- }
- fprintf(stdout, "\rče seštejemo vsa števila od %llu do %llu, razen %llu, bo\n"
- "vsota vseh %llu, kar je %llu*%llu.\n", o, d, i, s, n, i);
- return 0;
-}