Rezultati

Up. imeNalogaJezikRezultatČas oddaje
C9-2017 Hodnik C++ 100/100OK 20. apr '17 @ 17:48

Test Točke Porabljen spomin Porabljen čas Status
#1 10/10 3,059 MiB 0,004 s OK
#2 10/10 3,059 MiB 0,004 s OK
#3 10/10 3,102 MiB 0,004 s OK
#4 10/10 3,059 MiB 0,004 s OK
#5 10/10 3,113 MiB 0,004 s OK
#6 10/10 3,113 MiB 0,004 s OK
#7 10/10 3,113 MiB 0,004 s OK
#8 10/10 3,129 MiB 0,004 s OK
#9 10/10 3,109 MiB 0,004 s OK
#10 10/10 3,129 MiB 0,004 s OK

Ocenjevani program (main.cpp):
#include <iostream>
#include <math.h>
#include <vector>
#include <stdio.h>
#include <string>
#include <algorithm>

using namespace std;


int main(){
    string a;
    cin>>a;
    int n=a.length();
    int b=0,c=0;
    for(int i=0;i<n;++i){
        if((int)a[i]-48==i%2){
            b++;
        }
        else{
            c++;
        }
    }
    cout<<(b<c?b:c);
    return 0;
}