A. Case of the Zeros and Ones

来源:互联网 发布:iphone6手机壳淘宝 编辑:程序博客网 时间:2024/06/05 06:47

题目链接:http://codeforces.com/contest/556/problem/A

#include <iostream>#include <cstdlib>using namespace std;int main(){    int m;    string s;    cin>>m>>s;    int j=0;    for(int i=0; i<m; i++)    {        if(s[i]=='0')            j++;    }    cout<<abs(m-2*j);    return 0;}
0 0
原创粉丝点击