summaryrefslogblamecommitdiffstats
path: root/šola/p2/dn/DN01b_63230317.c
blob: 6952c95b5334e8f5b59bfaf7d15d2a7f0793906d (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

















                                        













                                                


                      
#include <stdio.h>
void printInt (int a) {
	if (a < 0) {
		a = -a;
		putchar('-');
	}
	int števke[29];
	int len = 0;
	while (a > 0) {
		števke[len++] = a%10;
		a /= 10;
	}
	for (int i = len-1; i >= 0; i--)
		putchar('0'+števke[i]);
}
int main (void) {
	while (getchar() == '0');
	int po_prvi_enici = 0;
	int ni_enic = 1;
	while (1)
		switch (getchar()) {
			case '1':
				ni_enic = 0;;
				// fall through
			case '0':
				po_prvi_enici++;
				break;
			default:
				goto done;
		}
	done:
	printInt(++po_prvi_enici-ni_enic);
	putchar('\n');
	return 0;
}