I have this C++ program but its not printing anything in the console. I am copying the content of the string in 2 vectors and doing count increment operations on them.
#include <iostream>
#include<vector>
#include<bits/stdc++.h>
#include<string>
using namespace std;
int main()
{
string s;
cin>>s;
int i,j;
vector<char> a;
vector<char> b;
int count1=0;
int count2=0;
int count3=0;
int t=s.length()/2;
for(i=0;i<t-1;t++)
{
a.push_back(s[i]);
}
for(j=t;j<s.length();j++)
{
b.push_back(s[j]);
}
int e1,e2;
for (auto it1 = a.begin(), it2 = b.begin();
it1 != a.end() && it2 != b.end();
++it1, ++it2)
{
if(int(*it1)>int(*it2))
count1++;
if(int(*it1)<int(*it2))
count2++;
if(int(*it1)==int(*it2))
count3++;
}
cout<<min(min(count1,count2),count3);
}
I am printing the minimum of the three counts in the end.