summaryrefslogtreecommitdiffstats
path: root/mat/advent/6/prog.c
diff options
context:
space:
mode:
authorsijanec <sijanecantonluka@gmail.com>2020-12-14 00:04:39 +0100
committersijanec <sijanecantonluka@gmail.com>2020-12-14 00:04:39 +0100
commitddff09bb8def69d35c43649736dd4c3a5f0aef7f (patch)
tree776b3e0fa9a05c6feab0b753ed21ab011ff28afd /mat/advent/6/prog.c
parentweekend reading 6 (diff)
parentodstranil dependency za f5ff, domača naloga 20 pri matematiki (diff)
downloadsola-gimb-2-ddff09bb8def69d35c43649736dd4c3a5f0aef7f.tar
sola-gimb-2-ddff09bb8def69d35c43649736dd4c3a5f0aef7f.tar.gz
sola-gimb-2-ddff09bb8def69d35c43649736dd4c3a5f0aef7f.tar.bz2
sola-gimb-2-ddff09bb8def69d35c43649736dd4c3a5f0aef7f.tar.lz
sola-gimb-2-ddff09bb8def69d35c43649736dd4c3a5f0aef7f.tar.xz
sola-gimb-2-ddff09bb8def69d35c43649736dd4c3a5f0aef7f.tar.zst
sola-gimb-2-ddff09bb8def69d35c43649736dd4c3a5f0aef7f.zip
Diffstat (limited to '')
-rw-r--r--mat/advent/6/prog.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/mat/advent/6/prog.c b/mat/advent/6/prog.c
new file mode 100644
index 0000000..14eb68a
--- /dev/null
+++ b/mat/advent/6/prog.c
@@ -0,0 +1,13 @@
+#include <stdio.h>
+#include <stdlib.h>
+int main (int argc, char ** argv) {
+ double x;
+ size_t s = 0;
+ for (double a = 1; a <= 2020; a++) {
+ x = ((float)7/(float)5)*(float)a;
+ if (x == (int)x)
+ s++;
+ }
+ fprintf(stderr, "%lu\n", s);
+ return 0;
+}