the code is not accepted by site although is its working fine in online complier
#include
using namespace std;
void check()
{
string s;
cin>>s;
int n=s.size();
int sum=0,sum1=0;
for(int i=0;i<(n/2);i++)
{
sum=sum+s[i];
sum1=sum1+s[n-i-1];
}
if(sum==sum1) cout<<“YES”<<endl;
else cout<<“NO”<<endl;
}
int main(){
int n;
cin>>n;
while(n–)
{
check();
}
return 0;
}
Please either format your code or (better!) link to your submission - the forum software has mangled it and it won’t compile!
@kunaluttam try the following input:
1
decf
(the output should of course be NO
)
You can put three backticks ``` on a line before and after code to preserve indentation etc.