Why i am getting a wrong answer in Chef and Chain (CHEFCH)

//Here is my code

using namespace std;
int main(){
    int testcase = 0,i = 0,cnt = 0;
    string s;
    if(testcase>1 && testcase<=7)
    if(s.size()>=1 && s.size()<=100000)
            if(s[i] == '+'){
                if(s[i+1] == '-'){
                      s[i+1] = '-';
                if(s[i+1] == '+'){
                      s[i+1] = '+';
        cnt = 0;
        return 0;

Why do you keep printing s.size() after every time you read s?

Also, your program tries to see if the next character is not equal to the current. This is ok. But, what about the first character? Currently, you are just keeping the first character as such, and then counting how many characters need to be changed. It might be the case the first character itself needs to be changed, in order to find the right answer.

1)sorry for that s.size(). I forget to remove that while pasting my code.

2)can u suggest me that testcase which giving me wrong answer.

Try the string +±±±±+
The correct answer is 1 (just change very first character to -)

thanks dude