-
#include<stdio.h>
#include<string.h> int main() {
int f,t,mid,len;
char arr[1000];
int left[125],right[125];
scanf("%d",&t);
for(int i=0;i<t;i++)
{
f=0;
scanf("%s",arr);
memset(left,0,sizeof(left));
memset(right,0,sizeof(right));
len=strlen(arr);
for(int i=0;i<len/2;i++)
left[arr[i]]++;
for(int i=(len+1)/2;i<len;i++)
right[arr[i]]++;
for(int i=0;i<strlen(arr);i++)
{
if(left[arr[i]]!=right[arr[i]])
f++;
break;
}
if(f==0)
printf(“YES\n”);
else
printf(“NO\n”);
}}
Its really difficult to get your code please put comments so that someone can help you
hey,I am getting error in line no 9.But i’m not getting that heck.or you can simply give me the code by using dynamic function lapindrome()(program is for lapindronme as you get it from function name) and the only used function is strlength().hope you get it.
main.cpp:1:1: error: ‘include’ does not name a type
include<isostream.h>
^
main.cpp: In function ‘int main()’:
main.cpp:8:18: error: ‘scanf’ was not declared in this scope
scanf("%d",&t);
^
main.cpp:12:35: error: ‘memset’ was not declared in this scope
memset(left,0,sizeof(left));
^
main.cpp:14:23: error: ‘strlen’ was not declared in this scope
len=strlen(arr); for(int i=0;i<len/2;i++) left[arr[i]]++; for(int i=(len+1)/2;i<len;i++) right[arr[i]]++;
^
main.cpp:19:36: error: ‘printf’ was not declared in this scope
if(f==0) printf(“YES\n”); else printf(“NO\n”);
^
main.cpp:19:57: error: ‘printf’ was not declared in this scope
if(f==0) printf(“YES\n”); else printf(“NO\n”);
^
main.cpp:20:13: error: expected ‘}’ at end of input
}
^
We can’t even recognize line 9 due to your poor formatting