Rezultati

Up. imeNalogaJezikRezultatČas oddaje
3-8byte-2018 Niz C++ 100/100OK 19. apr '18 @ 17:08

Test Točke Porabljen spomin Porabljen čas Status
#1 10/10 3,109 MiB 0,000 s OK
#2 10/10 3,109 MiB 0,000 s OK
#3 10/10 3,297 MiB 0,009 s OK
#4 10/10 3,297 MiB 0,009 s OK
#5 10/10 3,297 MiB 0,003 s OK
#6 10/10 3,297 MiB 0,016 s OK
#7 10/10 3,297 MiB 0,000 s OK
#8 10/10 3,297 MiB 0,009 s OK
#9 10/10 3,297 MiB 0,009 s OK
#10 10/10 3,297 MiB 0,009 s OK

Ocenjevani program (Niz.cpp):
//============================================================================
// Name        : Niz.cpp
// Author      : 
// Version     :
// Copyright   : 
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;

int main() {
	int dolzina,stevec=0; string podatek;
	cin>>dolzina;
	cin>>podatek;

		for (unsigned int i=1;i<podatek.length()-1;i++) {
			if (podatek[i-1]=='0' && podatek[i]=='1' && podatek[i+1]=='0') {
				stevec++;
				i+=2;
			}
		}

	cout<<stevec;
	return 0;
}