Is This a Give-Away?

Once there lived an ancient mage named Farabi. He could always give perfect weather forecast. He never revealed how. After he died no one could predict the weather perfectly anymore. In his lifetime, he wrote a book in an encrypted language. After so many years and so many trials, a brilliant coder named Masum broke the encryption.


This is a companion discussion topic for the original entry at https://toph.co/p/is-this-a-give-away

#include
#include<string.h>
using namespace std;
int main(){
char t [100003];
scanf ("%s", t) ;
int s = 0 , a = 0 , l = strlen ( t );
for( int i = 0 ; i <= l / 2; i++) if( t[i] == ‘{’ ) s++;
for( int i = l ; i>=l/2; i–) if( t[i] == ‘}’ ) a++;
cout<< min ( a , s );
}
what’s the problem with my code here?