t=int(input()) for j in range(t): s=input() def co(a,b): c=0 for i in b: if(i==a): c+=1 return c for i in s: if(co(i,s)==len(s)/2): print("YES") break else: print("NO")
#include<stdio.h> #include<string.h> int co(char,char); void main(){ char s[50]; int i,c; scanf("%s",s); while(s[i]!='\0'){ if(co(s[i],s)==len(s)/2) printf("YES"); else printf("NO"); i++; } } int co(char a,char b[50]){ int i,c=0; while(b[i]!='\0'){ if(b[i]==a) c++; } return c; }
int i,c; scanf("%s",s); while(s[i]!='\0'){
i
int main()
int co(char a,char b[50])
int co(char a,char *b)
len
strlen
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)