diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2022-12-02 17:20:17 +0100 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2022-12-02 17:20:17 +0100 |
commit | 74f4e1c44ae340377c395b1d467b70363f060c64 (patch) | |
tree | 235ea69ff5e366a123e2660981a7132e72f54f6a /mat | |
parent | slo (diff) | |
download | sola-gimb-4-74f4e1c44ae340377c395b1d467b70363f060c64.tar sola-gimb-4-74f4e1c44ae340377c395b1d467b70363f060c64.tar.gz sola-gimb-4-74f4e1c44ae340377c395b1d467b70363f060c64.tar.bz2 sola-gimb-4-74f4e1c44ae340377c395b1d467b70363f060c64.tar.lz sola-gimb-4-74f4e1c44ae340377c395b1d467b70363f060c64.tar.xz sola-gimb-4-74f4e1c44ae340377c395b1d467b70363f060c64.tar.zst sola-gimb-4-74f4e1c44ae340377c395b1d467b70363f060c64.zip |
Diffstat (limited to 'mat')
-rw-r--r-- | mat/advent/0.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mat/advent/0.c b/mat/advent/0.c new file mode 100644 index 0000000..26b9753 --- /dev/null +++ b/mat/advent/0.c @@ -0,0 +1,16 @@ +#include <stdio.h> +#include <stdlib.h> +int šp (int število, int prafaktor) { + int vrni = 0; + while (!(število % prafaktor)) { + vrni++; + število /= prafaktor; + } + return vrni; +} +int main (void) { + int število = 0; + for (int i = 1; i < 100; i++) + število += šp(i, 7); + printf("%d\n", število); +} |