1 条题解

  • -2
    @ 2023-8-1 15:28:17

    #include<bits/stdc++.h> using namespace std; int main() { string s; cin>>s; int t=0,p=s.size(); for(int i=1;i<=p;i++){ if(s[i-1]'0'){ s[i]=1; }if(s[i-1]'1'){ s[i]=0; } if(s[i]=='1'){ t++; s[i]=0; }else{ t++; s[i]=1; }

    } cout<<t;

    }

    • 1

    信息

    ID
    979
    时间
    1000ms
    内存
    256MiB
    难度
    4
    标签
    递交数
    29
    已通过
    7
    上传者