summaryrefslogblamecommitdiffstats
path: root/šola/p2/dn/DN01b_63230317.c
blob: 88ef9a9d983105f8897ea5fe20c7e4ce2a5270f0 (plain) (tree)
1
2
3
4
5
6





                             








                                      
         



                                 













                                                


                      
#include <stdio.h>
void printInt (int a) {
	if (a < 0) {
		a = -a;
		putchar('-');
	}
	int l = 1;
	int c = a/10;
	while (c > 0) {
		l *= 10;
		c /= 10;
	}
	while (l) {
		putchar('0'+(a/l)%10);
		l /= 10;
	}
}
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;
}