Rezultati

Up. imeNalogaJezikRezultatČas oddaje
domaco-2018 Niz C 100/100OK 19. apr '18 @ 17:09

Test Točke Porabljen spomin Porabljen čas Status
#1 10/10 1,457 MiB 0,005 s OK
#2 10/10 1,461 MiB 0,000 s OK
#3 10/10 1,488 MiB 0,000 s OK
#4 10/10 1,457 MiB 0,004 s OK
#5 10/10 1,488 MiB 0,004 s OK
#6 10/10 1,461 MiB 0,000 s OK
#7 10/10 1,461 MiB 0,010 s OK
#8 10/10 1,461 MiB 0,004 s OK
#9 10/10 1,457 MiB 0,004 s OK
#10 10/10 1,461 MiB 0,004 s OK

Ocenjevani program (naloga1.c):
#include <stdio.h>
#include <string.h>

int main(){
    int d;
    scanf("%d", &d);

    //char *niz;
    //scanf("%s", niz);

    int st = 0;
    char a, b , c;
    a = getchar();
    b =getchar();
    int stevec = 0;
    while(stevec < d){
        c = getchar();
        if(a == '0' && b == '1' && c == '0'){
            c = '1';
            st++;
        }

        a = b;
        b = c;
        stevec++;

    }

    printf("%d\n", st);
    return 0;

}