summaryrefslogtreecommitdiffstats
path: root/mat/advent/8/prog.c
blob: 7597ae65d8c38eac459453983f0f838b9cbb8483 (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 <stdlib.h>
int main (int argc, char ** argv) {
	char x[69] = "";
	int vsebuje = 0;
	int j = 0;
	int z = 0;
	for (int i = 1; i <= 2021; i++) {
		sprintf(x, "%d", i);
		vsebuje = 0;
		for (j = 0; j <= 1234; j++) {
			if (x[j] == '1') {
				vsebuje = 1;
			}
			if (x[j] == '\0') {
				break;
			}
		}
		if (vsebuje == 0) {
			z++;
		}
	}
	fprintf(stdout, "%d \n", z);
}