From 63c6de829ec31ca53acc20e7681c7e034dd0d61a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Sun, 3 Mar 2024 23:51:25 +0100 Subject: p2.DN01 --- "\305\241ola/p2/dn/DN01b_63230317.c" | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 "\305\241ola/p2/dn/DN01b_63230317.c" (limited to 'šola/p2/dn/DN01b_63230317.c') diff --git "a/\305\241ola/p2/dn/DN01b_63230317.c" "b/\305\241ola/p2/dn/DN01b_63230317.c" new file mode 100644 index 0000000..cebcc83 --- /dev/null +++ "b/\305\241ola/p2/dn/DN01b_63230317.c" @@ -0,0 +1,24 @@ +#include +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; + while ((getchar() & ~1) == '0') + po_prvi_enici++; + printInt(++po_prvi_enici); + putchar('\n'); + return 0; +} -- cgit v1.2.3