id
int32 0
32.5k
| code
stringlengths 95
8.4k
| label
stringclasses 65
values |
---|---|---|
600 |
struct data{
int code;
char author[20];
};
struct letter{
char let;
int count;
};
int main()
{
int n,i,j,k,t,max;
struct data a[100];
struct letter l[26];
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i].code);
gets(a[i].author);
}
for(i=0;i<26;i++)
{
l[i].let=i+65;
l[i].count=0;
}
for(i=0;i<n;i++)
{
for(j=0;a[i].author[j]!='\0';j++)
{
for(k=0;k<26;k++)
{
if(a[i].author[j]==l[k].let)
l[k].count++;
}
}
}
max=0;
for(k=0;k<26;k++) {
if(l[k].count>max)
{ max=l[k].count;
t=k;}
}
printf("%c\n",l[t].let);
printf("%d\n",l[t].count);
for(i=0;i<=n-1;i++)
{
for(j=0;a[i].author[j]!='\0';j++)
{
if(a[i].author[j]==l[t].let)
printf("%d\n",a[i].code);
}
}
return 0;
}
| 2 |
601 | //****************************************
//*??????? **
//*?????? 1100012763 **
//*???2011.11.14 **
//****************************************
int main()
{
int n , number , i , j , k , t , len , max;
int map[26][1000] = {0};
char name[27];
cin >> n;
for (i = 0; i <= 25; i++)
map[i][0] = 0;
for (i = 1; i <= n; i++)
{
cin >> number >> name;
len = strlen(name);
for (j = 0; j <= len - 1; j++)
{
k = name[j] - 'A';
map[k][0]++;
t = map[k][0];
map[k][t] = number;
}
}
max = 0;
for (i = 0; i <= 25; i++)
{
if (map[i][0] > max)
{
max = map[i][0];
k = i;
}
}
cout << (char)(65 + k) << endl;
cout << map[k][0];
for (i = 1; i <= map[k][0]; i++)
cout << endl << map[k][i];
return 0;
} | 2 |
602 | struct person{
int num;
int book[1000];
};
struct person p[26];
int n,m,i,j,k;
char str[30];
int main(){
memset(p,0,sizeof(p));
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d%s",&m,str);
for(j=strlen(str)-1;j>=0;j--)
if(str[j]>='A'&&str[j]<='Z'){
k=p[str[j]-'A'].num++;
p[str[j]-'A'].book[k]=m;
}
}
m=0;
for(i=1;i<26;i++)
if(p[i].num>p[m].num)
m=i;
printf("%c\n",'A'+m);
printf("%d\n",p[m].num);
for(i=0;i<p[m].num;i++)
printf("%d\n",p[m].book[i]);
return 0;
}
| 2 |
603 | int w[26]={0};//zimu 0 26
int p=0;
void zimu(char a[]){
int m,i,j;
char c;
m=strlen(a);
for(j=0;j<26;j++){
c='A'+j;
for(i=0;i<m;i++){
if(a[i]==c)
w[j]++;
}
}//for1 end
}
int max(int w[26]){
int i,max;
max=w[0];
for(i=1;i<26;i++)
if(w[i]>max){
max=w[i];
p=i;
}
return max;
}
void main(){
char b[300][20];
int a[300];
int m,i,j,mm;
scanf("%d",&m);
for(i=0;i<m;i++)
scanf("%d%s",&a[i],b[i]);
for(i=0;i<m;i++)
zimu(b[i]);
mm=max(w);
printf("%c\n",p+'A');
printf("%d\n",mm);
for(i=0;i<m;i++){
for(j=0;j<(strlen(b[i]));j++)
if(b[i][j]==(p+'A')){
printf("%d\n",a[i]);
break;
}
}
}
| 2 |
604 | int main(){
int n[26]={0};
char z[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
char nn[26][100][20];
int m,i,j,r;
char a[100][100];
scanf("%d",&m);
for(j=0;j<m;j++){
scanf("%s",a[j]);
char b[20];
scanf("%s",b);
int w=strlen(b);
for(i=0;i<w;i++){
for(r=0;r<26;r++){
if(b[i]==z[r]){
n[r]++;
strcpy(nn[r][n[r]],a[j]);
}
}
}
}
int c=0;
for(r=1;r<26;r++){
if(n[r]>n[c])
c=r;
}
printf("%c\n%d\n",z[c],n[c]);
for(i=1;i<=n[c];i++){
printf("%s\n",nn[c][i]);
}
}
| 2 |
605 |
void function(int,int);
int main()
{
char s[200][100];
int n[100],h[100],maxh[100];
int a;
int i,j,k,p;
int num,maxnum=0;
char c;
scanf("%d",&a);
for(i=0;i<a;i++)
{
scanf("%d%s",&n[i],s[i]);
}
for(j='A';j<='Z';j++)
{
num=0;
for(i=0;i<a;i++)
{
for(k=0;k<strlen(s[i]);k++)
{
if(s[i][k]==j)
{
num++;
h[num]=n[i] ;
}
}
}
if(num>maxnum)
{
c=j;
maxnum=num;
for(p=1;p<=maxnum;p++)
{
maxh[p]=h[p];
}
}
}
printf("%c\n%d\n",c,maxnum);
for(p=1;p<=maxnum;p++)
{
printf("%d\n",maxh[p]);
}
return 0;
} | 2 |
606 | void main()
{
struct book{
int num;
char str[30];
}bk[1000]={0};
int i,j,m,n,sum[100]={0},number[1000]={0},result,max=0;
char temp='A';
scanf("%d",&m);
for(i=0;i<m;i++)
scanf("%d %s",&bk[i].num,&bk[i].str);
for(i=65;i<=90;i++){
for(j=0;j<m;j++){
for(n=0;n<26;n++)
if(bk[j].str[n]==i)
sum[i]++;
}
}
for(j=0;j<26;j++){
if(sum[j+65]>max){
max=sum[j+65];
temp=j+65;
result=j+65;
}
}
for(i=0;i<m;i++){
for(n=0;n<30;n++)
if(bk[i].str[n]==temp){
number[i]=bk[i].num;
break;
}
}
printf("%c\n%d\n",temp,sum[result]);
for(i=0;i<m;i++)
if(number[i]!=0)
printf("%d\n",number[i]);
}
| 2 |
607 | int main(int argc, char* argv[])
{
int s[26]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
struct book{
int a;
char name[27];
};
struct book list[999];
char c;
int n,i,j,b,maxnum=0,max;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d%s",&list[i].a,list[i].name);
for(j=0;list[i].name[j]!='\0';j++){
c=list[i].name[j];
b=c-'A';
s[b]++;
}
}
for(i=0;i<26;i++){
if(s[i]>maxnum){
maxnum=s[i];
max=i;
}
}
printf("%c\n%d\n",'A'+max,maxnum);
for(i=0;i<n;i++){
for(j=0;list[i].name[j]!='\0';j++){
if(list[i].name[j]-'A'==max){
printf("%d\n",list[i].a);
}
}
}
return 0;
}
| 2 |
608 | void main()
{
int n,i,j,no[1000],shu[26]={0},max=0;
char s[1000][20],c;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d%s",&no[i],s[i]);
for(j=0;j<strlen(s[i]);j++)
{
shu[s[i][j]-'A']++;
}
}
for(i=0;i<26;i++)
{
if(shu[i]>max)
{
max=shu[i];
c='A'+i;
}
}
printf("%c\n%d\n",c,max);
for(i=0;i<n;i++)
{
if(strchr(s[i],c))
printf("%d\n",no[i]);
}
} | 2 |
609 | struct info
{
int nam;
char aut[27];
}inf[1000];
void main()
{
int n,i,a[26]={0},k,max=0,sum=0;
char *p;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d%s",&inf[i].nam,inf[i].aut);
for(i=0;i<n;i++)
{
p=inf[i].aut;
while(*p!='\0')
{
a[*p-65]++;
p++;
}
}
for(i=0;i<26;i++)
max=max>a[i]?max:a[i];
for(i=0;i<26;i++)
{if(a[i]==max){printf("%c\n",i+65);break;}}
k=i+65;
for(i=0;i<n;i++)
{
p=inf[i].aut;
while(*p!='\0')
{if(*p==k){sum++;break;}p++;}
}printf("%d\n",sum);
for(i=0;i<n;i++)
{
p=inf[i].aut;
while(*p!='\0')
{if(*p==k){printf("%d\n",inf[i].nam);break;}
p++;
}
}
}
| 2 |
610 | struct books
{char num[20];
char w[26];};
int main()
{int k,j,i,m;
int b[150]={0};
scanf("%d",&m);
struct books a[1000];
for(i=0;i<m;i++)
{scanf("%s %s",a[i].num,a[i].w);
for(j=0;a[i].w[j]!='\0';j++)
b[a[i].w[j]]++;
}
int max=0;
for(i='A',j=0;i<='Z';i++)
if (max<b[i]) {max=b[i];j=i;}
printf("%c\n",j);
printf("%d\n",max);
int n=0;
for(i=0;i<m;i++)
{
n=0;
for(k=0;a[i].w[k]!='\0';k++)
if (a[i].w[k]==j)n=1;
if(n==1) printf("%s\n",a[i].num);
}
} | 2 |
611 |
struct student
{int num;
char s[26];
}stu[999];
int main()
{ int m,a[26]={0},i,j,max,k,l=0;
scanf("%d",&m);
for(i=0;i<m;i++)
scanf("%d%s",&stu[i].num,stu[i].s);
for(i=0;i<26;i++)
for(k=0;k<m;k++)
for(j=0;j<strlen(stu[k].s);j++)
if(stu[k].s[j]=='A'+i)
a[i]++;
max=a[0];
for(i=1;i<26;i++)
if(a[i]>max)
{ max=a[i];l=i;}
printf("%c\n",'A'+l);
printf("%d\n",max);
for(i=0;i<m;i++)
for(j=0;j<strlen(stu[i].s);j++)
if(stu[i].s[j]=='A'+l)
{ printf("%d\n",stu[i].num);
break;}
return 0;
}
| 2 |
612 | void main()
{
struct book
{
int bianhao;
char zuozhe[100];
}a[1000];
int i,j,n,l,max;
int b[26]={0};
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d %s",&a[i].bianhao,a[i].zuozhe);
for(i=0;i<n;i++)
for(j=0;a[i].zuozhe[j]!='\0';j++)
b[a[i].zuozhe[j]-65]++;
max=b[0];
l=0;
for(i=1;i<=25;i++)
{
if(b[i]>max)
{
max=b[i];
l=i;
}
}
printf("%c\n",l+65);
printf("%d\n",max);
for(i=0;i<n;i++)
for(j=0;a[i].zuozhe[j]!='\0';j++)
if(a[i].zuozhe[j]==(l+65))
{
printf("%d\n",a[i].bianhao);
break;
}
}
| 2 |
613 | struct shu
{
int num;
char a[26];
struct shu*next;
};
int main()
{
char ma='A';
struct shu *p1,*p2;
struct shu*head,*p;
int cnt[128]={0};
int i,j,n,m;
scanf("%d",&n);
p1=p2=(struct shu*)malloc(l);
scanf("%d%s",&p1->num,p1->a);
m=strlen(p1->a);
for(j=0;j<m;j++){
if(++cnt[p1->a[j]]>cnt[ma])
ma=p1->a[j];
}
head=NULL;
for(i=1;i<n;i++){
if(i==1)head=p1;
else p2->next=p1;
p2=p1;
p1=(struct shu*)malloc(l);
scanf("%d%s",&p1->num,p1->a);
m=strlen(p1->a);
for(j=0;j<m;j++){
if(++cnt[p1->a[j]]>cnt[ma])
ma=p1->a[j];
}
}
p2->next=p1;
p2=p1;
p2->next=NULL;
p=head;
printf("%c\n%d\n",ma,cnt[ma]);
while(p!=NULL){
m=strlen(p->a);
for(i=0;i<m;i++){
if(p->a[i]==ma){
printf("%d\n",p->num);
break;
}
}
p=p->next;
}
return 0;
}
| 2 |
614 | struct student
{
int num;
char str[27];
struct student *next;
};
int n;
struct student *creat(int m)
{
struct student *head;
struct student *p1,*p2;
p1=p2=(struct student*)malloc(LEN);
scanf("%ld %s",&p1->num,p1->str);
n=1;
head=0;
while(n<m)
{
if(n==1)head=p1;
else p2->next=p1;
p2=p1;
p1=(struct student *)malloc(LEN);
scanf("%d %s",&p1->num,p1->str);
n=n+1;
}
p2->next=p1;
p1->next=0;
return(head);
}
void main()
{
struct student *head,*p,stu;
int m,i,t,max,y=1,a[100]={0},sum[27]={0};
char x,c;
scanf("%d",&m);
head=creat(m);
p=head;
for(;p!=0;p=p->next)
{
for(t=0;t<strlen(p->str);t++)
{
c=p->str[t];
sum[c-'A'+1]++;
}
}
max=sum[1];
x=1;
for(i=1;i<=26;i++)
if(sum[i]>max){max=sum[i];x=i;}
for(p=head;p!=0;p=p->next)
{
for(t=0;t<=strlen(p->str);t++)
if(p->str[t]==x+'A'-1) {a[y]=p->num;y++;t=strlen(p->str)+1;}
}
printf("%c\n%d\n",x+64,max);
for(y=1;y<=max;y++)
printf("%d\n",a[y]);
}
| 2 |
615 | int main()
{
int m,i,j,a[1000],c[91]={0},k,n,p=0;
char b[1000][26],q;
scanf("%d", &m);
for(i=1;i<=m;i++)
{
scanf("%d%s", &a[i], b[i]);
n=strlen(b[i]);
for(j=0;j<=n-1;j++)
{
k=b[i][j];
c[k]++;
}
}
for(i=65;i<91;i++) if(c[i]>p) {p=c[i]; q=i;}
printf("%c\n%d\n", q, p);
for(i=1;i<=m;i++)
{
n=strlen(b[i]);
for(j=0;j<=n-1;j++) if(b[i][j]==q) printf("%d\n", a[i]);
}
return 0;
}
| 2 |
616 | struct a
{
int num;
char s[20];
struct a *next;
}
main()
{
int n,i,a[26],b[26]={0},t,j,max;
struct a *p1,*p2,*head;
scanf("%d",&n);
head=p1=(struct a *)malloc(L);
scanf(M,&p1->num,p1->s);
for(i=1;i<n;i++)
{
p2=p1;
p1=(struct a *)malloc(L);
p2->next=p1;
scanf(M,&p1->num,p1->s);
}
p1->next=NULL;
for(i=0;i<26;i++)
a[i]=65+i;
for(i=0;i<26;i++)
{ p1=head;
while(p1!=NULL)
{
for(j=0;p1->s[j]!='\0';j++)
if(a[i]==p1->s[j])
b[i]++;
p1=p1->next;
}
}
max=b[0];t=0;
for(i=1;i<26;i++)
if(b[i]>max)
{
max=b[i];
t=i;
}
printf("%c\n%d\n",a[t],max);
p1=head;
while(p1!=NULL)
{
for(j=0;p1->s[j]!='\0';j++)
if(a[t]==p1->s[j])
{printf("%d\n",p1->num);break;}
p1=p1->next;
}
}
| 2 |
617 | struct book
{
int num;
char zhuzhe[26];
int let;
};
struct book shu[1000];
int judge(char a,char b)
{
if(a==b)return(1);
else return(0);
}
void main()
{
int n,i,j,y,zhi,num;
char writer1[26]={0};
char writer2[26]={0};
for(i=0;i<26;i++)
writer2[i]=i+65;
scanf("%d",&n);
for(i=0;i<n;i++)
{scanf("%d",&shu[i].num);
gets(shu[i].zhuzhe);
}
for(i=0;i<n;i++)
for(j=0;shu[i].zhuzhe[j]!='\0';j++)
for(y=0;y<26;y++)
if(writer2[y]==shu[i].zhuzhe[j])writer1[y]=writer1[y]+1;
zhi=0;
num=0;
for(i=0;i<26;i++)
if(writer1[i]>zhi){zhi=writer1[i];num=i;}
for(i=0;i<n;i++)
for(j=0;shu[i].zhuzhe[j]!='\0';j++)
if(judge(shu[i].zhuzhe[j],writer2[num])==1)shu[i].let=1;
printf("%c\n",writer2[num]);
printf("%d\n",writer1[num]);
for(i=0;i<n-1;i++)
if(shu[i].let==1)printf("%d\n",shu[i].num);
if(shu[n-1].let==1)printf("%d",shu[n-1].num);
}
| 2 |
618 |
int main()
{
int bkn,m=1,n,i,j;
char bka[30];
struct author
{
int num;
int p[200];
}
a[30];
scanf("%d",&n);
for(i=1;i<27;i++)
a[i].num=0;
for(i=0;i<n;i++)
{
scanf("%d%s",&bkn,bka);
for(j=0;j<strlen(bka);j++)
{
a[bka[j]-64].num++;
a[bka[j]-64].p[a[bka[j]-64].num-1]=bkn;
}
}
for(i=2;i<27;i++)
if(a[i].num>a[m].num)
m=i;
printf("%c\n%d\n",m+64,a[m].num);
for(i=0;i<a[m].num;i++)
printf("%d\n",a[m].p[i]);
return 0;
}
| 2 |
619 | void main()
{
int a[1000],i,j,m,b[26],t=0,k;
char c[1000][20];
scanf("%d",&m);
for(i=0;i<m;i++)
scanf("%d %s",&a[i],c[i]);
for(i=0;i<m;i++)
for(j=0;j<strlen(c[i]);j++)
if('A'<c[i][j]<'Z') b[c[i][j]-65]++;
for(i=0;i<26;i++)
if(b[i]>t){t=b[i];k=i;}
printf("%c\n",k+65);
printf("%d\n",t);
for(i=0;i<m;i++)
for(j=0;j<strlen(c[i]);j++)
{
if(c[i][j]==k+65) printf("%d\n",a[i]);
}
} | 2 |
620 | struct book
{
int num;
char author[27];
}book[1000];
void main()
{
int m,i,j,k;
char s[26];
int w[26]={0};
int len[1000];
int max,most;
scanf("%d",&m);
for(i=0;i<m;i++)
{
scanf("%d %s",&book[i].num,book[i].author);
}
for(i=0;i<26;i++)
{
s[i]='A'+i;
}
for(i=0;i<m;i++)
{
len[i]=strlen(book[i].author);
for(j=0;j<len[i];j++)
{
for(k=0;k<26;k++)
{
if(book[i].author[j]==s[k])
w[k]++;
}
}
}
max=w[0];
most=0;
for(i=0;i<26;i++)
{
if(w[i]>max)
{
max=w[i];
most=i;
}
}
printf("%c\n%d\n",s[most],max);
for(i=0;i<m;i++)
{
len[i]=strlen(book[i].author);
for(j=0;j<len[i];j++)
{
if(book[i].author[j]==s[most])
printf("%d\n",book[i].num);
}
}
} | 2 |
621 | struct book
{
int num;
char author[26];
};
int main()
{
int n;
scanf("%d\n",&n);
int i;
struct book book[1000];
for(i=0;i<n;i++)
{
scanf("%d %s",&book[i].num,book[i].author);
}
int b[26]={0};
for(i=0;i<n;i++)
{
int l;
l=strlen(book[i].author);
int j;
for(j=0;j<l;j++)
{
b[book[i].author[j]-65]=b[book[i].author[j]-65]+1;
}
}
int max=b[0];
for(i=0;i<26;i++)
{
if(b[i]>max) max=b[i];
}
for(i=0;i<26;i++)
{
if(b[i]==max) break;
}
char p;
p=i+65;
printf("%c\n%d\n",p,max);
for(i=0;i<n;i++)
{ int j,l;
l=strlen(book[i].author);
for(j=0;j<l;j++)
{
if(book[i].author[j]==p) {printf("%d\n",book[i].num);break;}
else if(book[i].author[j]!=p&&j==l-1) break;
}
}
return 0;
}/*????????*/
| 2 |
622 | struct book
{
int id;
char s[26];
}a[100];
int main()
{
int m,i,n,j,k,max,maxnum;
int aut1[26]={0},aut2[26][100]={0};
scanf("%d",&m);
for(i=0;i<m;i++)
{
scanf("%d",&a[i].id);
gets(a[i].s);
n=strlen(a[i].s);
for(j=0;j<n;j++)
{
k=a[i].s[j]-'A';
aut2[k][aut1[k]]=a[i].id;
aut1[k]++;
}
}
max=0;maxnum=0;
for(i=0;i<26;i++)
{
if(aut1[i]>max)
{
max=aut1[i];
maxnum=i;
}
}
printf("%c\n",'A'+maxnum);
printf("%d\n",max);
printf("%d",aut2[maxnum][0]);
for(i=1;i<max;i++)
{
printf("\n%d",aut2[maxnum][i]);
}
}
| 2 |
623 | int n;
struct book
{
int num;
char name[20];
struct book *next;
}*p1,*p2;
//????
struct book *creat(void)
{
struct book *head;
int i;
head=0;
p1=0;
p2=0;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
p1=(struct book *)malloc(LEN);
scanf("%d %s",&p1->num,p1->name);
if(head==0)
head=p1;
else
p2->next=p1;
p2=p1;
}
p2->next=0;
return(head);
}
void main()
{
struct book *head,*p;
char a[27],*q,c;
int b[27],i,m,n1=0,max;//??a??????????b?????????????
for(i=1;i<27;i++)
{
a[i]=0;
b[i]=0;
}
head=creat();
for(p=head;p!=0;p=p->next)//p++???p=p->next
{
for(q=p->name;*q!='\0';q++)
{
m=0;
for(i=1;i<=n1;i++)//???????????????????????????????????????1
if(*q==a[i])
{
m=1;
b[i]++;
break;
}
if(m==0)
{
n1++;//??n1???n
a[n1]=*q;
b[n1]=1;
}
}
}
max=b[1];c=a[1];
for(i=1;i<=n1-1;i++)
if(b[i]>max)
{
c=a[i];
max=b[i];
}
printf("%c\n",c);
printf("%d\n",max);
for(p=head;p!=0;p=p->next)
{
m=0;
for(q=p->name;*q!='\0';q++)
if(*q==c)
{
m=1;
break;
}
if(m)
printf("%d\n",p->num);//?????????
}
}
| 2 |
624 |
struct book
{ int num;
char peo[26];
} book[999];
int main()
{ char zm,max;
int n,i,k,num,cishu=-1;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d %s",&book[i].num,&book[i].peo);
}
for(zm='A';zm<='Z';zm++){
num=0;
for(i=0;i<n;i++){
for(k=0;k<26;k++){
if(book[i].peo[k]==zm)
num++;
}
}
if(num>cishu){
cishu=num;
max=zm;
}
}
printf("%c\n",max);
printf("%d\n",cishu);
for(i=0;i<n;i++){
for(k=0;k<26;k++){
if(book[i].peo[k]==max)
printf("%d\n",book[i].num);
}
}
return 0;
} | 2 |
625 | int main()
{
int number[1001],num[27]={0},ascii[27];
char a[1001][27],p;
int i,j,m,n,t1,t;
cin>>m;
n=26;
for(i=0;i<m;i++)
{
cin>>number[i];
cin>>a[i];
for(j=0;j<strlen(a[i]);j++)
{
num[a[i][j]-'A']++;
}
}
for(i=0;i<n;i++)
{
ascii[i]=i;
}
for(i=0;i<n;i++)
{
for(j=n-1;j>0;j--)
{
if(num[j]>num[j-1])
{
t=num[j];
num[j]=num[j-1];
num[j-1]=t;
t1=ascii[j];
ascii[j]=ascii[j-1];
ascii[j-1]=t1;
}
}
}
p='A'+ascii[0];
cout<<p<<endl;
cout<<num[0]<<endl;
for(i=0;i<m;i++)
{
for(j=0;j<strlen(a[i]);j++)
{
if(a[i][j]==p)
{
cout<<number[i]<<endl;
break;
}
}
}
return 0;
}
| 2 |
626 | struct j
{
int bianhao;
char zuozhe[100];
};
main()
{
int m,i,l,k,z,max=0;
int shumu[26];
scanf("%d",&m);
struct j * a;
a=(struct j *)malloc(m*sizeof(j));
for(i=0;i<m;i++)
{
scanf("%d %s",&a[i].bianhao,a[i].zuozhe);
}
for(z=0;z<26;z++)
{
shumu[z]=0;
for(i=0;i<m;i++)
{
char * p;
p=a[i].zuozhe;
l=strlen(a[i].zuozhe);
for(k=0;k<l;k++)
{
if(p[k]=='A'+z)
shumu[z]++;
}
}
}
for(z=0;z<26;z++)
{
if(shumu[z]>max)
max=shumu[z];
}
for(z=0;z<26;z++)
{
if(shumu[z]==max)
{
printf("%c\n%d\n",z+'A',max);
for(i=0;i<m;i++)
{
char * p;
p=a[i].zuozhe;
l=strlen(a[i].zuozhe);
for(k=0;k<l;k++)
{
if(p[k]=='A'+z)
printf("%d\n",a[i].bianhao);
}
}
break;
}
}
}
| 2 |
627 | int N;
int A[2013],Ans[1222];
char W[2013][28];
double Max(double X,double Y)
{
return X > Y ? X : Y;
}
int main()
{
cin >> N;
for (int I = 1; I <= N; I ++)
cin >> A[I] >> W[I];
for (int I = 1; I <= N; I ++)
{
int L = strlen(W[I]);
for (int J = 0; J < L; J ++) Ans[W[I][J]] ++;
}
int Max = 0,T;
for (int I = 65; I <= 'Z'; I ++)
if (Ans[I] > Max)
{
Max = Ans[I];
T = I;
}
printf("%c\n%d\n",T,Max);
for (int I = 1; I <= N; I ++)
{
int L = strlen(W[I]);
for (int J = 0; J < L; J ++)
if (W[I][J] == T) cout << A[I] << endl;
}
} | 2 |
628 | int main()
{
int n,i,j,k;
scanf("%d\n",&n);
struct book
{
int num;
char name[26];
}book[999];
for(i=0;i<n;i++)
{ scanf("%d %s\n",&book[i].num,book[i].name);
}
struct author
{
char l;
int count;
}au[26];
for(i=0;i<26;i++)
{ au[i].l=65+i;
au[i].count=0;
}
for(i=0;i<26;i++)
{ for(j=0;j<n;j++)
{ for(k=0;k<26;k++)
{if(au[i].l==book[j].name[k])
{au[i].count++;
break;
}
}
}
}
int max=0;
for(i=1;i<26;i++)
{ if(au[max].count<au[i].count)
max=i;
}
printf("%c\n%d\n",au[max].l,au[max].count);
for(j=0;j<n;j++)
{ for(k=0;k<26;k++)
{
if(au[max].l==book[j].name[k])
{ printf("%d\n",book[j].num);
break;
}
}
}
return 0;
}
| 2 |
629 | struct book
{
int num;
char wr[26];
struct book *next;
};
void main()
{
int i,n,m=0,j,a,b,c;
int s[100]={0};
scanf("%d",&n);
struct book *head,*p1,*p2,*p;
p1=p2=(struct book *)malloc(LEN);
scanf("%d %s",&p1->num,p1->wr);
head=NULL;
while(m!=n-1)
{
m=m+1;
if(m==1) head=p1;
else p2->next=p1;
p2=p1;
p1=(struct book *)malloc(LEN);
scanf("%d %s",&p1->num,p1->wr);
}
p2->next=p1;
p2=p1;
p2->next=NULL;
p=head;
do
{
b=strlen(p->wr);
for(j=0;j<b;j++)
s[p->wr[j]]++;
p=p->next;
}while(p!=NULL);
a=s[65];
c=65;
for(i=66;i<91;i++)
if(a<s[i])
{
a=s[i];
c=i;
}
printf("%c\n%d\n",c,a);
p=head;
do
{
b=strlen(p->wr);
for(j=0;j<b;j++)
if(p->wr[j]==c)
printf("%d\n",p->num);
p=p->next;
}while(p!=NULL);
} | 2 |
630 | int main()
{
int n;
int i,j,k;
int max,max2;
int a[26];
struct book
{
int number;
char author[26];
}stu1[1000];
struct author
{
int number[1000];
int ben;
}stu2[26];
scanf("%d",&n);
for(i=0;i<=n-1;i++)
scanf("%d %s",&stu1[i].number,stu1[i].author);
for(i=0;i<=25;i++)
{
stu2[i].ben=0;
a[i]=0;
} //???
for(i=0;i<=n-1;i++)
{
for(j=0;j<=strlen(stu1[i].author)-1;j++)//j????????
{
k=stu1[i].author[j];//k???????? ?A?
stu2[k-65].ben++;//stu2[x]???1
stu2[k-65].number[a[k-65]]=stu1[i].number;//??????????????
a[k-65]++;//?????1
}
}
max=stu2[0].ben;
max2=0;//?A?????
for(i=1;i<=25;i++)
{
if(stu2[i].ben>max)
{
max=stu2[i].ben;
max2=i;//?????????
}
}
printf("%c\n",max2+65);
printf("%d\n",max);
for(j=0;j<=a[max2]-1;j++) //????+1? ????
printf("%d\n",stu2[max2].number[j]);
return 0;
}
| 2 |
631 | struct book
{
int num;
char writer[20];
struct book *next;
};
int main()
{
int n,i,j,m,k,c[26],max;//c[26]???????????//
char a[26];//a[26]??????//
scanf("%d",&m);
struct book *p1,*p2,*head;
for(i=0;i<m;i++)
{
p1=(struct book*)malloc(Len);
if(i==0)
{
head=p1;
}
else
{
p2->next=p1;
}
p2=p1;
scanf("%d %s",&p1->num,p1->writer);
}
p2->next=NULL;
p1=head;
for(i=0;i<26;i++)
{
a[i]=i+65;
c[i]=0;
}
for(j=0;j<m;j++)
{
for(i=0;i<26;i++)
{
n=strlen(p1->writer);
for(k=0;k<n;k++)
{
if(a[i]==p1->writer[k])
{
c[i]++;
}
}
}
p1=p1->next;
}
max=0;
for(i=0;i<26;i++)
{
if(c[i]>c[max])
{
max=i;
}
}
printf("%c\n%d\n",a[max],c[max]);
p1=head;
for(i=0;i<m;i++)
{
n=strlen(p1->writer);
for(j=0;j<n;j++)
{
if(p1->writer[j]==a[max])
{
printf("%d\n",p1->num);
}
}
p1=p1->next;
}
return 0;
}
| 2 |
632 | struct stu
{
int num;
char c[26];
struct stu*next;
};
struct stu*create(void)
{
struct stu *p1,*p2,*head;
int m;
scanf("%d",&m);
p1=(struct stu*)malloc(LEN);
scanf("%d %s",&p1->num,p1->c);
p2=p1;
head=p1;
while(m-1)
{
m--;
p1=(struct stu*)malloc(LEN);
scanf("%d %s",&p1->num,p1->c);
p2->next=p1;
p2=p1;
}
p2->next=NULL;
return head;
}
void print(struct stu*head,int z)
{
struct stu*q;
int i,k;
char s[20],s0[20]={'\0'};
q=head;
while(q)
{
strcpy(s,q->c);
k=strlen(s);
for(i=0;i<k;i++)
if(s[i]==z+65)
{
printf("%d\n",q->num);
break;
}
strcpy(s,s0);
q=q->next;
}
}
void main()
{
int index;
int a[26],k,t,i,max=0;
char s[20],s0[20]={'\0'};
struct stu*p,*head;
memset(a,0,sizeof(a));
head=create();
p=head;
while(p)
{
strcpy(s,p->c);
k=strlen(s);
for(i=0;i<k;i++)
{
t=s[i]-65;
a[t]++;
}
strcpy(s,s0);
p=p->next;
}
for(i=0;i<26;i++)
if(a[i]>max)
{
max=a[i];
index=i;
}
printf("%c\n%d\n",index+65,max);
print(head,index);
}
| 2 |
633 | main()
{
int i,j,m,a[26]={0},max=0;
struct book
{
int no;
char w[26];
}
s[1000];
scanf("%d",&m);
for (i=0;i<m;i++)
{
scanf("%d %s",&s[i].no,s[i].w);
for (j=0;j<strlen(s[i].w);j++)
a[s[i].w[j]-'A']++;
}
for (i=0;i<26;i++)
if (a[i]>a[max])
max=i;
printf("%c\n%d\n",max+'A',a[max]);
for (i=0;i<m;i++)
for (j=0;j<strlen(s[i].w);j++)
if (s[i].w[j]==max+'A')
printf("%d\n",s[i].no);
}
| 2 |
634 | int main()
{
int m,i,a[1000]={0},count[30]={0},temp,j,max=-999,flag;
char s[1000][30]={0},cha;
scanf("%d", &m);
for(i=1;i<=m;i++)
{
scanf("%d", &a[i]);
for(j=1;j<30;j++)
{
scanf("%c", &s[i][j]);
if(s[i][j]==' ')
{
s[i][j]=0;
continue;
}
if(s[i][j]=='\n')
{
s[i][j]=0;
break;
}
temp=s[i][j]-'A'+1;
count[temp]+=1;
}
}
for(i=1;i<=26;i++)
{
if(count[i]>=max)
{
flag=i;
max=count[i];
}
}
printf("%c\n%d\n", flag+64,max);
cha='A'+flag-1;
for(i=1;i<=m;i++)
{
for(j=1;j<30;j++)
{
if(s[i][j]==cha)
{
printf("%d\n", a[i]);
}
}
}
return 0;
}
| 2 |
635 | int main()
{
struct author
{
char nm;
int bk[999];
int count;
};
struct author a[26];
struct author max;
struct book
{
char at[26];
int no;
};
struct book b;
int i,j,n,m,k,flag;
for(i=0;i<26;i++)
{
a[i].count=0;
a[i].nm=65+i;
}
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d%s",&b.no, b.at);
m=strlen(b.at);
flag=0;
for(j=0;j<m;j++)
{
for(k=0;k<26;k++)
{
if(b.at[j]==a[k].nm)
{
a[k].bk[a[k].count]=b.no;
a[k].count++;
flag++;
break;
}
}
if(flag==m)
break;
}
}
max=a[0];
for(i=1;i<26;i++)
{
if(a[i].count>max.count)
{
max=a[i];
}
}
printf("%c\n%d\n",max.nm,max.count);
for(i=0;i<max.count;i++)
{
printf("%d\n",max.bk[i]);
}
return 0;
}
| 2 |
636 | int main()
{
int m,a[1000],i,n,j,k;
scanf("%d",&m);
char b[1000][27];
int count[26]={0};
for(i=0;i<m;i++)
{
scanf("%d %s",&a[i],b[i]);
}
for(i=0;i<m;i++)
{
n=strlen(b[i]);
for(j=0;j<n;j++)
{
for(k=0;k<26;k++)
{
if(b[i][j]==k+65)count[k]++;
}
}
}
int max,maxk;
max=count[0];
maxk=0;
for(k=0;k<26;k++)
{
if(count[k]>max)
{
max=count[k];
maxk=k;
}
}
char mauthor;
mauthor=maxk+65;
printf("%c\n%d\n",mauthor,max);
for(i=0;i<m;i++)
{
n=strlen(b[i]);
for(j=0;j<n;j++)
{
if(b[i][j]==mauthor)
{
printf("%d\n",a[i]);
break;
}
}
}
return 0;
}
| 2 |
637 |
void main()
{
int i,j,m,a[26][999],num[26]={0},t,max;
char zz[27];
scanf("%d",&m);
for(i=0;i<m;i++)
{
scanf("%d%s",&t,zz);
for(j=0;j<strlen(zz);j++)
{
a[(int)(zz[j]-'A')][num[(int)(zz[j]-'A')]]=t;
num[(int)(zz[j]-'A')]++;
}
}
max=0;
for(i=0;i<26;i++)
{
if(num[i]>num[max])
max=i;
}
printf("%c\n%d\n",max+'A',num[max]);
for(i=0;i<num[max];i++)
printf("%d\n",a[max][i]);
} | 2 |
638 | struct cs
{
int b;
char a[26];
};
int main()
{
int m,i,j,k,max=0;
int c[200][1000],count[200]={0};
struct cs x[1000];
scanf("%d",&m);
for(i=0;i<m;i++)
{
scanf("%d",&x[i].b);
gets(x[i].a);
}
for(i=0;i<m;i++)
{
for(j=0;j<strlen(x[i].a);j++)
{
for(k=65;k<91;k++)
{
if(x[i].a[j]==k)
{count[k]++;
c[k][count[k]]=x[i].b;
}
}
}
}
for(k=65;k<91;k++)
{
if(count[k]>max)
max=count[k];
}
for(k=65;k<91;k++)
{
if(count[k]==max)
{
printf("%c\n%d\n",k,count[k]);
for(j=1;j<=max;j++)
{
printf("%d\n",c[k][j]);
}
}
}
return 0;
} | 2 |
639 |
struct book{
int num;
char s[27];
};
struct author{
int num;
int bn[1000];
};
int main()
{
int m,i,j,l,max=0;
char c;
struct book bk[1000];
struct author au['Z'+1],t;
scanf("%d",&m);
for(j=0;j<'Z'+1;j++)
au[j].num=0;
for(i=0;i<m;i++)
{
scanf("%d %s",&bk[i].num,bk[i].s);
l=strlen(bk[i].s);
for(j=0;j<l;j++)
au[bk[i].s[j]].bn[au[bk[i].s[j]].num++]=bk[i].num;
}
for(j=0;j<'Z'+1;j++)
if(au[j].num>max)
{ t=au[j];
c=j;
max=au[j].num;}
printf("%c\n",c);
printf("%d\n",t.num);
for(i=0;i<t.num;i++)
printf("%d\n",t.bn[i]);
return 0;
}
| 2 |
640 | struct people
{
int a;
char name[26];
};
void main()
{
struct people pl[1000];
int i,j,k,l=0,n,s,m,max,x[26];
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d %s",&pl[i].a,pl[i].name);
}
for(i=0;i<n;i++)
{
m=strlen(pl[i].name);
for(j=0;j<m;j++)
for(k=0;k<26;k++)
if(k==pl[i].name[j]-'A')
{
x[k]++;
break;
}
}
max=x[0];
for(i=0;i<26;i++)
if(x[i]>max) max=x[i];
for(i=0;i<26;i++)
if(x[i]==max)
{
printf("%c\n",'A'+i);
s=i;
printf("%d\n",x[i]);
break;
}
for(i=0;i<n;i++)
for(j=0;j<26;j++)
if(pl[i].name[j]=='A'+s)
{
printf("%d\n",pl[i].a);
break;
}
}
| 2 |
641 | void main()
{
struct s
{
int a;
char b[100];
struct s *next;
};
struct s *p1,*p2,*head;
int m,n,i,j,k,t,d[50],max;
char c;
scanf("%d",&n);
p1=(struct s *)malloc(sizeof(struct s));
p2=p1;
head=p1;
scanf("%d %s",&p1->a,p1->b);
for(i=0;i<n-1;i++)
{
p1=(struct s *)malloc(sizeof(struct s));
p2->next=p1;
p2=p1;
scanf("%d %s",&p1->a,p1->b);
}
p2->next=0;
t=0;
p1=p2=head;
for(c='A';c<='Z';c++)
{
k=0;
for(i=0;i<n;i++)
{
j=0;
while(p1->b[j]!='\0')
{
if(c==p1->b[j])
k++;
j++;
}
p1=p1->next;
}
d[t]=k;
t++;
p1=head;
}
j=0;
max=d[0];
for(i=1;i<26;i++)
if(d[i]>max)
{
max=d[i];
j=i;
}
printf("%c\n",'A'+j);
printf("%d\n",max);
t='A'+j;
for(i=0;i<n;i++)
{
j=0;
while(p1->b[j]!='\0')
{
if(t==p1->b[j])
printf("%d\n",p1->a);
j++;
}
p1=p1->next;
}
} | 2 |
642 | int main()
{
char writer[1000][30];
char abc[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
int m,n,mark[1000], num[26]={0}, sum=0, i, j;
scanf("%d", &m);
for(i=0;i<m;i++)
{
scanf("%d", &mark[i]);
scanf("%s", writer[i]);
}
for(i=0;i<m;i++)
{
for(j=0;j<strlen(writer[i]);j++)
{
if(writer[i][j]=='A')
num[0]++;
else if(writer[i][j]=='B')
num[1]++;
else if(writer[i][j]=='C')
num[2]++;
else if(writer[i][j]=='D')
num[3]++;
else if(writer[i][j]=='E')
num[4]++;
else if(writer[i][j]=='F')
num[5]++;
else if(writer[i][j]=='G')
num[6]++;
else if(writer[i][j]=='H')
num[7]++;
else if(writer[i][j]=='I')
num[8]++;
else if(writer[i][j]=='J')
num[9]++;
else if(writer[i][j]=='K')
num[10]++;
else if(writer[i][j]=='L')
num[11]++;
else if(writer[i][j]=='M')
num[12]++;
else if(writer[i][j]=='N')
num[13]++;
else if(writer[i][j]=='O')
num[14]++;
else if(writer[i][j]=='P')
num[15]++;
else if(writer[i][j]=='Q')
num[16]++;
else if(writer[i][j]=='R')
num[17]++;
else if(writer[i][j]=='S')
num[18]++;
else if(writer[i][j]=='T')
num[19]++;
else if(writer[i][j]=='U')
num[20]++;
else if(writer[i][j]=='V')
num[21]++;
else if(writer[i][j]=='W')
num[22]++;
else if(writer[i][j]=='X')
num[23]++;
else if(writer[i][j]=='Y')
num[24]++;
else if(writer[i][j]=='Z')
num[25]++;
}
}
for(i=0;i<26;i++)
{
if(num[i]>=sum)
{
sum=num[i];
n=i;
}
}
printf("%c\n",abc[n]);
printf("%d\n", num[n]);
for(i=0;i<m;i++)
{
for(j=0;j<strlen(writer[i]);j++)
{
if(writer[i][j]==abc[n])
{
printf("%d\n",mark[i]);
break;
}
}
}
scanf("%d",&m);
return 0;
} | 2 |
643 | struct book
{ char name[20];
int num;
struct book *next;
};
struct book *creat(int m)
{
int i;
struct book *head,*p1,*p2;
p1=(struct book *)malloc(len);
scanf("%d",&p1->num);
scanf("%s",p1->name);
p1->next=null;
head=p1;
p2=p1;
for(i=1;i<m;i++)
{
p1=(struct book *)malloc(len);
scanf("%d",&p1->num);
scanf("%s",p1->name);
p1->next=null;
p2->next=p1;
p2=p1;
}
return(head);
}
void main()
{
struct book *p,*head;
int i,a[26],m;
char *q;
scanf("%d",&m);
head=creat(m);
p=head;
char s[30];
for(i=0;i<26;i++)
a[i]=0;
while(p){
i=0;
strcpy(s,p->name);
while(s[i]!='\0')
{
a[s[i]-'A']++;
i++;
}
p=p->next;
}
/* for(i=0;i<26;i++)
printf("%d",a[i]);*/
//??
int max=0,max_p;
for(i=0;i<26;i++)
{
if(a[i]>max) {max=a[i];max_p=i+'A';}
}
printf("%c\n%d\n",max_p,max);
//find max
p=head;
int x=0;
char c[20];
while(p){
i=0;
strcpy(c,p->name);
while(c[i]!='\0')
{
if(c[i]==max_p) x=1;
i++;
}
if(x==1) printf("%d\n",p->num);
x=0;
p=p->next;
//if(strchr(p->name,max_p)) printf("%d\n",p->num);
}
//??
}
| 2 |
644 | struct a{
int n;
char s[27];
}b[1000];
int main()
{
int n;
scanf("%d",&n);
int i,k;
for(i=0;i<n;i++)
{
scanf("%d %s",&b[i].n,b[i].s);
}
int c[26]={0};
for(i=0;i<n;i++)
{
for(k=0;b[i].s[k];k++)
{switch(b[i].s[k]){
case 'A':c[0]++;break;
case 'B':c[1]++;break;
case 'C':c[2]++;break;
case 'D':c[3]++;break;
case 'E':c[4]++;break;
case 'F':c[5]++;break;
case 'G':c[6]++;break;
case 'H':c[7]++;break;
case 'I':c[8]++;break;
case 'J':c[9]++;break;
case 'K':c[10]++;break;
case 'L':c[11]++;break;
case 'M':c[12]++;break;
case 'N':c[13]++;break;
case 'O':c[14]++;break;
case 'P':c[15]++;break;
case 'Q':c[16]++;break;
case 'R':c[17]++;break;
case 'S':c[18]++;break;
case 'T':c[19]++;break;
case 'U':c[20]++;break;
case 'V':c[21]++;break;
case 'W':c[22]++;break;
case 'X':c[23]++;break;
case 'Y':c[24]++;break;
case 'Z':c[25]++;break;
}}
}
int j,max=0;
for(i=0;i<26;i++)
{
if(c[i]>max)
{ max=c[i];
j=i;}
}
int t=0;
switch(j){
case 0:printf("A\n%d\n",max);
for(i=0;i<n;i++)
{
for(k=0;b[i].s[k];k++)
{
if(b[i].s[k]=='A')
printf("%d\n",b[i].n);
}
}
break;
case 1:printf("B\n%d\n",max);
for(i=0;i<n;i++)
{
for(k=0;b[i].s[k];k++)
if(b[i].s[k]=='B')
printf("%d\n",b[i].n);
}
break;
case 2:printf("C\n%d\n",max);for(i=0;i<n;i++){for(k=0;b[i].s[k];k++)if(b[i].s[k]=='C')printf("%d\n",b[i].n);}break;
case 3:printf("D\n%d\n",max);for(i=0;i<n;i++){for(k=0;b[i].s[k];k++)if(b[i].s[k]=='D')printf("%d\n",b[i].n);}break;
case 4:printf("E\n%d\n",max);for(i=0;i<n;i++){for(k=0;b[i].s[k];k++)if(b[i].s[k]=='E')printf("%d\n",b[i].n);}break;
case 5:printf("F\n%d\n",max);for(i=0;i<n;i++){for(k=0;b[i].s[k];k++)if(b[i].s[k]=='F')printf("%d\n",b[i].n);}break;
case 6:printf("G\n%d\n",max);for(i=0;i<n;i++){for(k=0;b[i].s[k];k++)if(b[i].s[k]=='G')printf("%d\n",b[i].n);}break;
case 7:printf("H\n%d\n",max);for(i=0;i<n;i++){for(k=0;b[i].s[k];k++)if(b[i].s[k]=='H')printf("%d\n",b[i].n);}break;
case 8:printf("I\n%d\n",max);for(i=0;i<n;i++){for(k=0;b[i].s[k];k++)if(b[i].s[k]=='I')printf("%d\n",b[i].n);}break;
case 9:printf("J\n%d\n",max);for(i=0;i<n;i++){for(k=0;b[i].s[k];k++)if(b[i].s[k]=='J')printf("%d\n",b[i].n);}break;
case 10:printf("K\n%d\n",max);for(i=0;i<n;i++){for(k=0;b[i].s[k];k++)if(b[i].s[k]=='K')printf("%d\n",b[i].n);}break;
case 11:printf("L\n%d\n",max);for(i=0;i<n;i++){for(k=0;b[i].s[k];k++)if(b[i].s[k]=='L')printf("%d\n",b[i].n);}break;
case 12:printf("M\n%d\n",max);for(i=0;i<n;i++){for(k=0;b[i].s[k];k++)if(b[i].s[k]=='M')printf("%d\n",b[i].n);}break;
case 13:printf("N\n%d\n",max);for(i=0;i<n;i++){for(k=0;b[i].s[k];k++)if(b[i].s[k]=='M')printf("%d\n",b[i].n);}break;
case 14:printf("O\n%d\n",max);for(i=0;i<n;i++){for(k=0;b[i].s[k];k++)if(b[i].s[k]=='O')printf("%d\n",b[i].n);}break;
case 15:printf("P\n%d\n",max);for(i=0;i<n;i++){for(k=0;b[i].s[k];k++)if(b[i].s[k]=='P')printf("%d\n",b[i].n);}break;
case 16:printf("Q\n%d\n",max);for(i=0;i<n;i++){for(k=0;b[i].s[k];k++)if(b[i].s[k]=='Q')printf("%d\n",b[i].n);}break;
case 17:printf("R\n%d\n",max);for(i=0;i<n;i++){for(k=0;b[i].s[k];k++)if(b[i].s[k]=='R')printf("%d\n",b[i].n);}break;
case 18:printf("S\n%d\n",max);for(i=0;i<n;i++){for(k=0;b[i].s[k];k++)if(b[i].s[k]=='S')printf("%d\n",b[i].n);}break;
case 19:printf("T\n%d\n",max);for(i=0;i<n;i++){for(k=0;b[i].s[k];k++)if(b[i].s[k]=='T')printf("%d\n",b[i].n);}break;
case 20:printf("U\n%d\n",max);for(i=0;i<n;i++){for(k=0;b[i].s[k];k++)if(b[i].s[k]=='U')printf("%d\n",b[i].n);}break;
case 21:printf("V\n%d\n",max);for(i=0;i<n;i++){for(k=0;b[i].s[k];k++)if(b[i].s[k]=='V')printf("%d\n",b[i].n);}break;
case 22:printf("W\n%d\n",max);for(i=0;i<n;i++){for(k=0;b[i].s[k];k++)if(b[i].s[k]=='W')printf("%d\n",b[i].n);}break;
case 23:printf("X\n%d\n",max);for(i=0;i<n;i++){for(k=0;b[i].s[k];k++)if(b[i].s[k]=='X')printf("%d\n",b[i].n);}break;
case 24:printf("Y\n%d\n",max);for(i=0;i<n;i++){for(k=0;b[i].s[k];k++)if(b[i].s[k]=='Y')printf("%d\n",b[i].n);}break;
case 25:printf("Z\n%d\n",max);for(i=0;i<n;i++){for(k=0;b[i].s[k];k++)if(b[i].s[k]=='Z')printf("%d\n",b[i].n);}break;
}
return 0;
}
| 2 |
645 | void main()
{
int n,i,c[26]={0},d[26]={0},j,s,t,k;
char b[26000],r,max;
scanf("%d\n",&n);
struct book
{
int num;
char author[26];
}a[999];
for(i=0;i<n;i++) scanf("%d %s\n",&a[i].num,&a[i].author);
strcpy(b,a[0].author);
for(i=1;i<n;i++) strcat(b,a[i].author);
s=strlen(b);
for(r='A',j=0;r<='Z',j<26;r++,j++)
for(i=0;i<s;i++) if(b[i]==r) c[j]++;
for(i=0;i<26;i++) d[i]=c[i];
for(j=0;j<25;j++)
for(i=0;i<25-j;i++)
if(d[i]<d[i+1]) {t=d[i];d[i]=d[i+1];d[i+1]=t;}
k=d[0];
for(i=0;i<26;i++) if(c[i]==k) max=i+65;
printf("%c\n%d\n",max,k);
for(i=0;i<n;i++)
for(j=0;j<26;j++)
if(a[i].author[j]==max) printf("%d\n",a[i].num);
}
| 2 |
646 | struct book
{
int num;
char aut[26];
}bo[999];
main()
{
int n,i,j,k,count[26],max;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d %s",&bo[i].num,&bo[i].aut);
}
for(i=0;i<26;i++)
count[i]=0;
for(i=0;i<n;i++)
{
for(j=0;j<26;j++)
{
if(bo[i].aut[j]-65>=0&&bo[i].aut[j]-65<26)
count[bo[i].aut[j]-65]++;
}
}
max=0;
for(i=0;i<26;i++)
{
if(count[i]>max)
{max=count[i];k=i;}
}
printf("%c\n%d\n",k+65,max);
for(i=0;i<n;i++)
{
for(j=0;j<26;j++)
{
if(bo[i].aut[j]-65==k)
printf("%d\n",bo[i].num);
}
}
} | 2 |
647 | struct score
{
char id[10];
char name[26];
}book[1000];
int main()
{
int i,j,k,n,num,max=0;
char maxname;
scanf("%d",&num);
for(i=0;i<num;i++){
scanf("%s",book[i].id);
scanf("%s",book[i].name);
}
for(i=0;i<26;i++){
n=0;
for(j=0;j<num;j++){
for(k=0;k<26;k++){
if(book[j].name[k]==('A'+i))n+=1;
}
}
if(n>max){
maxname='A'+i;
max=n;
}
}
printf("%c\n%d\n",maxname,max);
for(j=0;j<num;j++){
for(k=0;k<26;k++){
if(book[j].name[k]==maxname)printf("%s\n",book[j].id);;
}
}
return 0;
}
| 2 |
648 |
main(){
int i, sum[26]={0}, m, j, max=0, p;
struct book{
int num;
char au[27];
int l;
};
struct book bk[1000];
scanf("%d", &m);
for(i=0; i<m; i++){
scanf("%d %s", &bk[i].num, bk[i].au);
bk[i].l=strlen(bk[i].au);
for(j=0; j<bk[i].l; j++){
switch(bk[i].au[j]){
case 'A': sum[0]+=1; break;
case 'B': sum[1]+=1; break;
case 'C': sum[2]+=1; break;
case 'D': sum[3]+=1; break;
case 'E': sum[4]+=1; break;
case 'F': sum[5]+=1; break;
case 'G': sum[6]+=1; break;
case 'H': sum[7]+=1; break;
case 'I': sum[8]+=1; break;
case 'J': sum[9]+=1; break;
case 'K': sum[10]+=1; break;
case 'L': sum[11]+=1; break;
case 'M': sum[12]+=1; break;
case 'N': sum[13]+=1; break;
case 'O': sum[14]+=1; break;
case 'P': sum[15]+=1; break;
case 'Q': sum[16]+=1; break;
case 'R': sum[17]+=1; break;
case 'S': sum[18]+=1; break;
case 'T': sum[19]+=1; break;
case 'U': sum[20]+=1; break;
case 'V': sum[21]+=1; break;
case 'W': sum[22]+=1; break;
case 'X': sum[23]+=1; break;
case 'Y': sum[24]+=1; break;
case 'Z': sum[25]+=1; break;
}
}
}
for(i=0; i<26; i++){
if(sum[i]>max){
max=sum[i];
p=i;
}
else;
}
printf("%c\n%d", p+65, max);
for(i=0; i<m; i++){
for(j=0; j<bk[i].l; j++){
if(bk[i].au[j]==p+65){
printf("\n%d", bk[i].num);
break;
}
else;
}
}
} | 2 |
649 |
int main()
{
int m;
char a[1000][10]={0}; //????
char b[1000][30]; //????
int len[1000]={0}; //?????????
int c[150]={0}; //???????
int max=0; //??????????????
int i,j,k,p,q,r,s; //????
scanf("%d", &m);
for(i=0;i<m;i++)
{
scanf("%s %s", a[i], b[i]);
len[i]=strlen(b[i]);
//printf("%d\n", len[i]);
for(j=0;j<len[i];j++)
{
//printf("%d\n", b[i][j]);
for(k=65;k<=90;k++)
{
if(b[i][j]==k)
c[k]++;
}
}
}
for(p=65;p<=90;p++)
{
if(c[p]>max)
max=c[p];
}
for(q=65;q<=90;q++)
{
if(c[q]==max)
{
printf("%c\n%d\n", q, max);
for(r=0;r<m;r++)
{
for(s=0;s<len[r];s++)
{
if(b[r][s]==q)
printf("%s\n", a[r]);
}
}
}
}
return 0;
} | 2 |
650 | int main(int argc, char* argv[])
{
int m,i,j=0,zhe[26],t=0,x,name;
for(i=0;i<26;i++)
{
zhe[i]=0;
}
char s[26];
scanf("%d",&m);
struct
{
int num;
char s[26];
}shu[1000];
for(i=0;i<m;i++)
{
scanf("%d%s",&shu[i].num,shu[i].s);
}
for(i=0;i<m;i++)
{
for(j=0;shu[i].s[j]!=0;j++)
{
switch(shu[i].s[j])
{
case 'A':zhe[0]++;break;
case 'B':zhe[1]++;break;
case 'C':zhe[2]++;break;
case 'D':zhe[3]++;break;
case 'E':zhe[4]++;break;
case 'F':zhe[5]++;break;
case 'G':zhe[6]++;break;
case 'H':zhe[7]++;break;
case 'I':zhe[8]++;break;
case 'J':zhe[9]++;break;
case 'K':zhe[10]++;break;
case 'L':zhe[11]++;break;
case 'M':zhe[12]++;break;
case 'N':zhe[13]++;break;
case 'O':zhe[14]++;break;
case 'P':zhe[15]++;break;
case 'Q':zhe[16]++;break;
case 'R':zhe[17]++;break;
case 'S':zhe[18]++;break;
case 'T':zhe[19]++;break;
case 'U':zhe[20]++;break;
case 'V':zhe[21]++;break;
case 'W':zhe[22]++;break;
case 'X':zhe[23]++;break;
case 'Y':zhe[24]++;break;
case 'Z':zhe[25]++;break;
}
}
}
for(j=0;j<26;j++)
{
if(zhe[j]>t)
{
t=zhe[j];
x=j;
}
}
name='A'+x;
printf("%c\n",name);
printf("%d\n",t);
for(i=0;i<m;i++)
{
for(j=0;j<26;j++)
{
if(shu[i].s[j]==name)
printf("%d\n",shu[i].num);
}
}
return 0;
} | 2 |
651 | struct student
{
char number[100];
char name[100];
struct student*next;
};
int n;
struct student*creat(void)
{
struct student *head;
struct student *p1,*p2;
int i=0;
p1=p2=(struct student*)malloc(LEN);
scanf("%s %s",&p1->number,&p1->name);
head=NULL;
do
{
i=i+1;
if(i==1)head=p1;else p2->next=p1;
p2=p1;
p1=(struct student*)malloc(LEN);
scanf("%s %s",&p1->number,&p1->name);
}
while(i<n-1);
p2->next=p1;
p2=p1;
p2->next=NULL;
return(head);
}
void main()
{
int h,i,k,m,j,max;
struct student*head;
struct student*p;
int sum[10000]={0};
scanf("%d",&n);
head=creat();/*????*/
p=head;
for(i=65,k=0;i<=90;i++,k++)/*???????????????*/
{
p=head;
do
{
m=strlen(p->name);
for(j=0;j<m;j++)
{
if(p->name[j]==i)sum[k]++;
}
p=p->next;
}while(p!=NULL);
}
for(i=0,max=sum[0];i<=k;i++)
{
if(sum[i]>=max){h=i;max=sum[i];}/*??????????????????????????????????????*/
}
printf("%c\n%d\n",h+65,max);/*???????????max??????sum[i]?????*/
p=head;
do
{
m=strlen(p->name);
for(j=0;j<m;j++)
{
if(p->name[j]==h+65)printf("%s\n",p->number);
}
p=p->next;
}while(p!=NULL);
}
/*?????????????????????????????????????????????????????????????????
???????????????????????????????????????????*/ | 2 |
652 | //????
int main()
{
int a,s[26][1000],m,i,j,author,max=0;//a????
char b[1000][28];//???
for (i=0;i<26;i++)
s[i][0]=0;
cin>>m;
for (i=0;i<m;i++)
{
cin>>a;
cin>>b[a];
for (j=0;b[a][j]!='\0';j++)
{
s[b[a][j]-'A'][0]++;//??????+1
s[b[a][j]-'A'][s[b[a][j]-'A'][0]]=a;//??????
}
}
for (i=0;i<26;i++)
{
if (s[i][0]>max)
{
max=s[i][0];
author=i;
}
}
cout<<(char)(author+'A')<<endl<<max<<endl;
for (j=1;j<=max;j++)
cout<<s[author][j]<<endl;
return 0;
} | 2 |
653 | struct book
{
char id[11];
char name[30];
};
struct au
{
int num;
char id[1000][11];
};
void main()
{
struct book b;
struct au a[26];
int n,i,j=0,k;
char c;
for(i=0;i<26;i++)
a[i].num=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%s%s",b.id,b.name);
while(b.name[j]!='\0')
{
k=b.name[j]-'A';
strcpy(a[k].id[a[k].num],b.id);
a[k].num++;
j++;
}
j=0;
}
k=0;
j=0;
for(i=0;i<26;i++)
{
j=(a[i].num>k)? i:j;
k=(a[i].num>k)? a[i].num:k;
}
printf("%c\n",'A'+j);
printf("%d\n",k);
for(i=0;i<k;i++)
printf("%s\n",a[j].id[i]);
} | 2 |
654 |
struct book
{
int number;
char auther[27];
}bk[1000];
struct ath
{
char a;
int books[999];
int sum;
}auth[27],temp;
void main()
{
int n,i,x,m,j;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d%s",&bk[i].number,bk[i].auther);
for(i=0;i<27;i++)
{
for(j=0;j<999;j++)
auth[i].books[j]=0;
auth[i].sum=0;
auth[i].a='A'+i;
}
for(i=0;i<n;i++)
{
m=strlen(bk[i].auther);
int f;
for(f=0;f<m;f++)
{
x=(int)(bk[i].auther[f]-'A');
auth[x].books[auth[x].sum]=bk[i].number;
auth[x].sum++;
}
}
for(j=0;j<25;j++)
for(i=0;i<25-j;i++)
if(auth[i].sum>auth[i+1].sum)
{temp=auth[i];auth[i]=auth[i+1];auth[i+1]=temp;}
printf("%c\n",auth[25].a);
printf("%d\n",auth[25].sum);
i=0;
while(auth[25].books[i]!=0)
{printf("%d\n",auth[25].books[i]);i++;}
}
| 2 |
655 | int main()
{
int b[26]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
int m,i,j,k,num[10000],max=0,t=0;
char a[10000][26];
char c[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
scanf("%d",&m);
for(i=0;i<m;i++)
{
scanf("%d",&num[i]);
scanf("%s",&a[i]);
}
for(i=0;i<m;i++)
{
for(j=0;j<26;j++)
{
for(k=0;k<26;k++)
{
if(a[i][j]==c[k])
b[k]++;
}
}
}
for(i=0;i<26;i++)
{
if(b[i]>max)
{
max=b[i];
t=i;
}
}
printf("%c\n",c[t]);
printf("%d\n",max);
for(i=0;i<m;i++)
{
for(j=0;j<26;j++)
{
if(a[i][j]==c[t])
{
printf("%d\n",num[i]);
break;
}
}
}
getchar();
getchar();
return 0;
} | 2 |
656 | struct book
{
int ID;
char author[30];
struct book *next;
};
int n,max=0;
char c;
struct book *create()
{
struct book *head,*p1,*p2;
p1=(struct book*)malloc(LEN);
scanf("%d %s",&p1->ID,p1->author);
head=p1;
p2=p1;
p1->next=NULL;
int i=1;
do
{
if(i==n)break;
p1=(struct book*)malloc(LEN);
scanf("%d %s",&p1->ID,p1->author);
p2->next=p1;
p2=p1;
p1->next=NULL;
i++;
}while(1);
return(head);
}
int main()
{
struct book *head;
int i;
int *num;
num=(int*)malloc(26*sizeof(int));
for(i=0;i<26;i++)
*(num+i)=0;
scanf("%d",&n);
head=create();
struct book *p;
char *s;
p=head;
while(p)
{
for(s=p->author;*s!='\0';s++)
{
int temp;
temp=*s-'A';
(*(num+temp))++;
}
p=p->next;
}
for(i=0;i<26;i++)
{
if(*(num+i)>max)max=*(num+i);
}
for(i=0;i<26;i++)
{
if(*(num+i)==max)break;
}
printf("%c\n%d\n",'A'+i,max);
c='A'+i;
p=head;
while(p)
{
for(s=p->author;*s!='\0';s++)
{
if(*s==c)break;
}
if(*s!='\0')printf("%d\n",p->ID);
p=p->next;
}
}
| 2 |
657 | int main ()
{
int m;
scanf ("%d",&m);
int a[1000];
char s[1000][26];
int i,j;
for (i=0;i<m;i++)
{
scanf ("%d %s",&a[i],s[i]);
}
char x;
int max=0;
char maxx;int l;
for (x='A';x<='Z';x++)
{
l=0;
for (i=0;i<m;i++)
{
for (j=0;j<26;j++)
{
if (s[i][j]==x)break;
}
if (j!=26)l++;
}
if (l>max){max=l;maxx=x;}
}
printf ("%c\n%d\n",maxx,max);
for (i=0;i<m;i++)
{
for (j=0;j<26;j++)
{
if(s[i][j]==maxx)break;
}
if (j!=26)printf ("%d\n",a[i]);
}
return 0;
}
| 2 |
658 | int a[30]={0},b[30][1000];
struct stu
{
int num;
char name[30];
struct stu *next;
};
struct stu *creat(int n)
{
struct stu *p1,*p2,*head;
int i=0;
p1=p2=(struct stu *)malloc(sizeof(struct stu));
scanf("%d %s",&p1->num,p1->name);
head=0;
for(i=0;i<n;i++)
{
if(i==0)
head=p1;
else
p2->next=p1;
p2=p1;
if(i<n-1)
{
p1=(struct stu *)malloc(sizeof(struct stu));
scanf("%d %s",&p1->num,p1->name);
}
}
p2->next=0;
return head;
}
int check(struct stu *head,int n)
{
int i,j,s,d=0,f=0;
char *t;
struct stu *p;
p=head;
for(i=0;i<n;i++,p=p->next)
{
s=strlen(p->name);
t=p->name;
for(j=0;j<s;j++)
{
d=t[j]-64;
a[d]++;
b[d][a[d]-1]=p->num;
}
}
for(i=1;i<=26;i++)
{
for(j=1,f=0;j<=26;j++)
{
if(a[i]<a[j])
{
f=1;
break;
}
}
if(f==0)
break;
}
return i;
}
void main ()
{
struct stu *head;
int i,j,n;
scanf("%d",&n);
head=creat(n);
i=check(head,n);
printf("%c\n%d\n",i+64,a[i]);
for(j=0;j<a[i];j++)
printf("%d\n",b[i][j]);
} | 2 |
659 | int main()
{
int n,amount[26],num[26][1000],num0,max=0;
char a;
memset(amount,0,sizeof(amount));
cin>>n;
for(int i=0;i<n;i++)
{
cin>>num0;
cin.get();
a=cin.get();
while(a!='\n')
{
num[a-65][amount[a-65]]=num0;
amount[a-65]++;
a=cin.get();
}
}
for(int i=0;i<26;i++)
if(max<amount[i])
max=amount[i];
for(int i=0;i<26;i++)
if(max==amount[i])
{
a=i+65;
cout<<a<<endl<<max<<endl;
for(int j=0;j<max;j++)
cout<<num[i][j]<<endl;
break;
}
return 0;
} | 2 |
660 |
int main()
{
char author[27];
int i,j,n,no,ab[26][1000]={0},an[26]={0},ma=0,na,am;
cin>>n;
for(;n>0;n--){
cin>>no>>author;
for(i=0;i<27;i++)
if(author[i]!='\0')ab[author[i]-'A'][an[author[i]-'A']]=no,an[author[i]-'A']++;
else break;}
for(i=0;i<26;i++)
{
na=0;
for(j=0;j<999;j++)
if(ab[i][j]!=0)na++;
else break;
if(na>ma)
ma=na,am=i;
}
cout<<(char)('A'+am)<<endl<<ma<<endl;
for(i=0;i<1000;i++)
if(ab[am][i]!=0)cout<<ab[am][i]<<endl;
else break;
return 0;
}
| 2 |
661 | struct data
{
int no;
char au[10];
};
void main()
{
struct data lib[1000];
char x;
int n,i,j,num[26]={0},l[1000],k,max;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&lib[i].no);
scanf("%s",lib[i].au);
l[i]=strlen(lib[i].au);
}
for(i=0;i<n;i++)
{
for(j=0;j<l[i];j++)
{
num[lib[i].au[j]-65]=num[lib[i].au[j]-65]+1;
}
}
max=num[0];
for(i=0;i<26;i++)
{
if(num[i]>max)
{
max=num[i];
k=i;
}
}
printf("%c\n",k+65);
printf("%d\n",max);
x=k+65;
for(i=0;i<n;i++)
{
for(j=0;j<l[i];j++)
{
if(lib[i].au[j]==x)
printf("%d\n",lib[i].no);
}
}
} | 2 |
662 | struct b
{
int na;
char au[20];
}book[1000];
int main()
{
int m,i,len[1000],num[128]={0},j,max,p=0;
char maxi;
int boo[1000];
scanf("%d",&m);
for(i=0;i<m;i++)
{
scanf("%d%s",&book[i].na,book[i].au);
len[i]=strlen(book[i].au);
for(j=0;j<len[i];j++)
num[book[i].au[j]]++;
}
maxi='A';
max=-1;
for(j='A';j<='Z';j++)
{
if(num[j]>max)
{
max=num[j];
maxi=j;
}
}
printf("%c\n",maxi);
printf("%d\n",max);
for(i=0;i<m&&p<max;i++)
{
for(j=0;j<len[i];j++)
{
if(book[i].au[j]==maxi)
{
printf("%d\n",book[i].na);
p++;
break;
}
}
}
return 0;
} | 2 |
663 | struct sa
{
int a;
char b[100];
struct sa *next;
};
int n,m,k[27];
struct sa *kao(void)
{
struct sa *head;
struct sa *p1,*p2;
n=0;
head=NULL;
p1=p2=(struct sa *)malloc(len);
scanf("%d %s",&p1->a,p1->b);
head=p1;
for(;;)
{
n++;
if(n==m+1)
break;
if(n==1)
head=p1;
else
{
p2=p1;
p1=(struct sa *)malloc(len);
scanf("%d %s",&p1->a,p1->b);
p2->next=p1;
}
}
p1->next=NULL;
return (head);
}
int main()
{
struct sa *p,*q,*head,*ped;
int f,i,g,s=1,t,d=0;
char c;
scanf("%d",&m);
head=kao();
for(p=head;p!=NULL;p=p->next)
{
g=strlen(p->b);
for(i=0;i<g;i++)
{
k[p->b[i]-64]++;
}
}
t=k[1];
for(i=2;i<27;i++)
{
if(k[i]>k[s])
{s=i;t=k[i];}
}
printf("%c\n%d\n",s+64,t);
for(p=head;p!=NULL;)
{
g=strlen(p->b);
for(i=0;i<g;i++)
{
if(p->b[i]==s+64)
{
d=1;break;
}
}
if(d==1)
printf("%d\n",p->a);
d=0;
p=p->next;
}
return 0;
}
| 2 |
664 |
main()
{
struct book
{
int num;
char name[26];
}b[1000];
int m,i,j,n[26]={0},max=0,t;
scanf("%d",&m);
for(i=0;i<m;i++)
{ scanf("%d %s",&b[i].num,b[i].name);
}
for(i=0;i<m;i++)
{
for(j=0;j<strlen(b[i].name);j++)
{ ++n[b[i].name[j]-65];
}
}
for(i=0;i<26;i++)
{
if(n[i]>max)
{ max=n[i];
t=i+65;
}
}
printf("%c\n",t);
printf("%d\n",max);
for(i=0;i<m;i++)
{
for(j=0;j<strlen(b[i].name);j++)
{ if(b[i].name[j]==t)
printf("%d\n",b[i].num);
}
}
}
| 2 |
665 |
struct author{
char num[4];
char str[27];
};
int main(int argc, char* argv[])
{
int m,i,j,zimu[26]={0},x,max;
char p;
scanf("%d",&m);
struct author *auth=(struct author *)malloc(sizeof(struct author)*m);
for(i=0;i<m;i++){
scanf("%s %s",auth[i].num,auth[i].str);
}
for(i=0;i<m;i++){
for(j=0;j<26;j++){
x=auth[i].str[j]-65;
zimu[x]++;
}
}
max=zimu[0];
for(i=0;i<26;i++){
if(zimu[i]>max){
max=zimu[i];
p=i;
}
}
printf("%c\n%d\n",p+65,max);
for(i=0;i<m;i++){
for(j=0;j<26;j++){
if(auth[i].str[j]==p+65){
printf("%s\n",auth[i].num);
}
}
}
free(auth);
return 0;
} | 2 |
666 | struct index
{
int num;
char wr[26];
};
int main()
{
int n,a[26],*pr,max;
char s[26],*sp,*pt,temp;
for(pr=a;pr<a+26;pr++)
{
*pr=0;
}
sp=s;
*sp=65;
for(sp=s+1;sp<s+26;sp++)
{
*sp=*(sp-1)+1;
}
struct index *p;
scanf("%d",&n);
struct index *ind=(struct index*)malloc(sizeof(struct index)*n);
for(p=ind;p<ind+n;p++)
{
scanf("%d %s",&p->num,p->wr);
}
for(p=ind;p<ind+n;p++)
{
for(pt=(*p).wr;pt<(*p).wr+26;pt++)
{
for(pr=a,sp=s;sp<s+26;sp++,pr++)
{
if(*pt==*sp)
{
(*pr)++;
}
}
}
}
max=*a;
temp=65;
for(pr=a,sp=s;pr<a+26;pr++,sp++)
{
if(*pr>max)
{
max=*pr;
temp=*sp;
}
}
for(pr=a,sp=s;sp<s+26;sp++,pr++)
{
if(*pr==max)
{
printf("%c\n%d\n",*sp,*pr);
}
}
for(p=ind;p<ind+n;p++)
{
for(pt=(*p).wr;pt<(*p).wr+26;pt++)
{
if(*pt==temp)
{
printf("%d\n",(*p).num);
}
}
}
free(ind);
return 0;
} | 2 |
667 | int main()
{
int n,i,j,k,t=0,c=0;
int A[25];
char g[]="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
struct point{
int a;
char s[80];
}tope[1000];
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d %s",&tope[i].a,tope[i].s);
}
for(k=0;k<26;k++)
{
A[k]=0;
for(i=0;i<n;i++){
for(j=0;tope[i].s[j]!='\0';j++)
{
if(tope[i].s[j]==g[k])
{
A[k]++;
}
}
}
}
for(i=0;i<26;i++)
{
if(A[i]>t)
{
t=A[i];
c=i;
}
}
printf("%c\n%d\n",g[c],t);
for(i=0;i<n;i++)
{
for(j=0;tope[i].s[j]!='\0';j++)
{
if(tope[i].s[j]==g[c])
{
printf("%d\n",tope[i].a);
}
}
}
return 0;
}
| 2 |
668 | struct book{
int num1;
char au[27];
}bk[1000];
struct author{
char name;
int a;
int num2[1000];
}aur[27];
int main()
{
int n,i,j;
struct author max;
max.a=0;
for(j=0;j<26;j++){
aur[j].name=65+j;
aur[j].a=0;
}
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d %s",&bk[i].num1,bk[i].au);
}
//??????,?????
for(i=0;i<n;i++){
for(j=0;bk[i].au[j]!='\0';j++){
aur[bk[i].au[j]-65].num2[aur[bk[i].au[j]-65].a]=bk[i].num1;
aur[bk[i].au[j]-65].a++;
}
}
//??????????
for(i=0;i<26;i++){
if(aur[i].a>max.a)max=aur[i];
}
printf("%c\n%d\n",max.name,max.a);
for(i=0;i<max.a;i++){
printf("%d\n",max.num2[i]);
}
return 0;
}
| 2 |
669 | struct author
{ int num;
char name[26];
};
struct author ren[100];
int main()
{ int n,i,j=0,k=0,biao,maxzuozhe,p,geshu[26]={0},max=0,maxdeshu[999];
scanf("%d\n",&n);
for(i=0;i<=n-1;i++)
{ scanf("%d",&ren[i].num);
scanf("%s",ren[i].name);
}
for(i=0;i<=25;i++)
{ for(j=0;j<=n-1;j++)
{
for(k=0;k<=strlen(ren[j].name);k++)
{ if((i+'A')==ren[j].name[k])
geshu[i]=geshu[i]+1;
}
}
}
for(i='A'-65;i<='Z'-65;i++)
{ if(max<geshu[i])
{max=geshu[i];
biao=i;}
}
maxzuozhe='A'+biao;
p=0;
for(i=0;i<=n-1;i++)
{ for(k=0;k<=strlen(ren[i].name);k++)
{ if(maxzuozhe==ren[i].name[k])
{maxdeshu[p]=ren[i].num;
p++;
break;}
}
}
printf("%c\n",maxzuozhe);
printf("%d\n",p);
for(i=0;i<=p-1;i++)
printf("%d\n",maxdeshu[i]);
getchar();
} | 2 |
670 | void main()
{
int n,i,j,k;
int at[26]={0};
char c;
scanf("%d",&n);
struct st
{
int id;
char s[27];
}a[999],*p;
for(p=a;p<a+n;p++)scanf("%d %s",&p->id,p->s);
for(i=0;i<n;i++)
{
for(j=0;;j++)
{
c=a[i].s[j];
if(c!='\0')at[c-65]++;
else break;
}
}
int max=0;
for(i=0;i<26;i++)
{
if(at[i]>max)
{
max=at[i];
j=i;
}
}
char x;
x=j+65;
printf("%c\n%d\n",x,max);
for(i=0;i<n;i++)
{
for(j=0;;j++)
{
c=a[i].s[j];
if(c==x)printf("%d\n",a[i].id);
if(c=='\0')break;
}
}
} | 2 |
671 | struct stu{
int id;
char author[26];
int length;
}a[1000];
int main(){
int n,i,k,num=0,max=0;
char b,c;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d%s",&a[i].id,a[i].author);
a[i].length=strlen(a[i].author);
}
for(b='A';b<='Z';b++){
num=0;
for(i=0;i<n;i++){
for(k=0;k<a[i].length;k++){
if(a[i].author[k]==b){
num++;
break;
}
}
}
if(num>max){
max=num;
c=b;
}
}
printf("%c\n%d\n",c,max);
for(i=0;i<n;i++){
for(k=0;k<a[i].length;k++){
if(a[i].author[k]==c){
printf("%d\n",a[i].id);
break;
}
}
}
return 0;
} | 2 |
672 | //********************************
//*???? ??(13.8) ????
//********************************
int main()
{
int n,i,nu,au,M,m;
int num[26] = {0};
int no[26][999];
char aut;
cin >> n;
for(i = 0; i < n; i++)
{
cin >> nu;
cin.get();
aut = cin.get();
while (aut != 10)
{
au = (int)(aut - 'A');
no[au][num[au]] = nu;
num[au]++;
aut = cin.get();
}
}
M = 0;
for(i = 0; i < 26; i++)
{
if(M < num[i])
{
M = num[i];
m = i;
}
}
cout << (char)(m + 'A') << endl;
cout << M << endl;
for(i = 0; i < M; i++)
cout << no[m][i] << endl;
cin.get();
cin.get(); //????
return 0;
}
| 2 |
673 | struct SHU
{
int bh;
char bz[26];
};
int main()
{
int m,i,j,l,k,p;
int name[200]={0},max,shuhao[1000];
struct SHU shu[1000];
scanf("%d",&m);
for(i=0;i<m;i++)
{
scanf("%d %s",&shu[i].bh,shu[i].bz);
}
for(i=0;i<m;i++)
{
l=strlen(shu[i].bz);
for(j=0;j<l;j++)
{
name[shu[i].bz[j]]++;
}
}
max=name[0];
for(i=0;i<200;i++)
{
if(name[i]>max)
{
max=name[i];
k=i;
}
}
p=0;
for(i=0;i<m;i++)
{
for(j=0;j<26;j++)
{
if(shu[i].bz[j]==k)
{
shuhao[p]=shu[i].bh;
p++;
}
}
}
printf("%c\n",k);
printf("%d\n",max);
for(i=0;i<p;i++)
{
printf("%d\n",shuhao[i]);
}
return 0;
}
| 2 |
674 | int main(){
struct book{
int num;
char name[26];
};
int n,i,j,a[26]={0},len[1000],k,max=0;
struct book list[1000];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&list[i].num);
scanf("%s",list[i].name);
len[i]=strlen(list[i].name);
}
for(i=0;i<26;i++){
for(j=0;j<n;j++){
for(k=0;k<len[j];k++){
if(list[j].name[k]==i+65){
a[i]++;
break;
}
}
}
}
for(i=0;i<26;i++){
if(a[i]>max){
max=a[i];
k=i;
}
}
printf("%c\n",k+65);
printf("%d\n",max);
for(i=0;i<n;i++){
for(j=0;j<len[i];j++){
if(list[i].name[j]==k+65){
printf("%d\n",list[i].num);
}
}
}
return 0;
} | 2 |
675 | int main()
{
int m,i,j,x,maxnumber;
scanf("%d",&m);
int booknum[1000];
char k[1000][30];
int author[27]={0};
for(i=1;i<=m;i++)
{
scanf("%d %s",&booknum[i],k[i]);
for(j=0;k[i][j]!='\0';j++)
{
author[k[i][j]-'A'+1]++;
}
}
int max=0;
for(i=1;i<=26;i++)
{
if(author[i]>max)
{
max=author[i];
maxnumber=i;
}
}
char who;
who='A'+maxnumber-1 ;
printf("%c\n",who);
printf("%d\n",max);
for(i=1;i<=m;i++)
{
for(j=0;j<strlen(k[i]);j++)
if(k[i][j]==who)
printf("%d\n",booknum[i]);
}
return 0;
}
| 2 |
676 | int main()
{
struct Book{
int id;
char zz[26];
}book[1000];
int n,i,j,max=0,index;
int sum[26]={0};
char author;
scanf("%d",&n);
for (i=0;i<n;i++){
scanf("%d%s",&book[i].id,&book[i].zz);
}
for (i=0;i<n;i++){
for (j=0;book[i].zz[j]!='\0';j++){
sum[book[i].zz[j]-'A']++;
}
}
for (i=0;i<26;i++){
if (sum[i]>max){
max=sum[i];
author='A'+i;
}
}
printf("%c\n%d\n",author,max);
for (i=0;i<n;i++){
for (j=0;book[i].zz[j]!='\0';j++){
if (book[i].zz[j]==author){
printf("%d\n",book[i].id);
break;
}
}
}
return 0;
} | 2 |
677 | struct information
{
int num;
char author[26];
}*a;
void main()
{
int n,i,j,m,s[26]={0},max=0,p;
scanf("%d",&n);
a=(struct information *)malloc(sizeof(struct information)*n);
for(i=0;i<n;i++) scanf("%d%s",&a[i].num,a[i].author);
for(i=0;i<n;i++)
{
for(j=0;a[i].author[j]!='\0';j++)
{
m=a[i].author[j]-'A';s[m]++;
}
}
for(i=0;i<26;i++)
{
if(max<s[i]) {max=s[i];p=i;}
}
printf("%c\n%d\n",'A'+p,s[p]);
for(i=0;i<n;i++)
{
for(j=0;j<26;j++)
{
if(a[i].author[j]=='A'+p) {printf("%d\n",a[i].num);break;}
}
}
} | 2 |
678 | int main()
{
int n,i,j,l,x,maxnumber;
scanf("%d",&n);
int a[1000];
char k[1000][30];
int author[27]={0};
for(i=1;i<=n;i++)
{
scanf("%d %s",&a[i],k[i]);
int m;
m=strlen(k[i]);
for(j=0;k[i][j]!='\0';j++)
{
author[k[i][j]-'A'+1]++;
}
}
int max=0;
for(i=1;i<=26;i++)
{
if(author[i]>max)
{
max=author[i];
maxnumber=i;
}
}
char who;
who='A'+maxnumber-1 ;
printf("%c\n",who);
printf("%d\n",max);
for(i=1;i<=n;i++)
{
for(l=0;l<=strlen(k[i]);l++)
if(k[i][l]==who)
printf("%d\n",a[i]);
}
return 0;
} | 2 |
679 |
struct
{
int a;
char b[26];
}shu[1000];
int main()
{
int s[27];
int n,i,j,o,max,t=1,x;
scanf("%d",&n);
for (i=0;i<n;i++)
scanf("%d %s",&shu[i].a,shu[i].b);
for (i=1;i<=26;i++)
s[i]=0;
for (i=0;i<n;i++)
for (j=0;j<strlen(shu[i].b);j++)
{
o=shu[i].b[j]-64;
s[o]++;
}
max=0;
for(i=1;i<=26;i++)
if (max<s[i]) {max=s[i];t=i;}
printf("%c\n",t+64);
printf("%d\n",max);
for (i=0;i<n;i++)
{
x=strlen(shu[i].b);
for (j=0;j<x;j++)
if (shu[i].b[j]==t+64)
printf("%d\n",shu[i].a);
}
return 0;
} | 2 |
680 | struct book
{
long int num;
char name[26];
}book[1000];
int main()
{
int m,i,j,r;
int writer[26]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
scanf("%d",&m);
for(i=0;i<m;i++)
{
scanf("%ld ",&book[i].num);
scanf("%s",book[i].name);
}
for(i=0;i<m;i++)
{
r=strlen(book[i].name);
for(j=0;j<r;j++)
{
writer[book[i].name[j]-'A']++;
}
}
int max=0;
char w='A';
for(i=0;i<26;i++)
{
if(writer[i]>max)
{
max=writer[i];
w=i+'A';
}
}
printf("%c\n",w);
printf("%d\n",max);
for(i=0;i<m;i++)
{
for(j=0;j<r;j++)
{
r=strlen(book[i].name);
if(book[i].name[j]==w)
{
printf("%ld\n",book[i].num);
}
}
}
return 0;
}
| 2 |
681 | void main()
{
int m,n,i,j,k,d,s;
int a,b=0,c;
int tt[1000],pp[1000],miao[26]={0};
char kk[1000][30];
char w;
scanf("%d",&m);
for(i=0;i<m;i++)
{
scanf("%d %s",&tt[i],kk[i]);
}
for(s=0,j=65;j<=90;j++,s++)
{
for(k=0;k<m;k++)
{
for(d=0;kk[k][d]!='\0';d++)
{
if(kk[k][d]==j) miao[s]++;
}
}
}
for(a=0;a<26;a++)
{
if(miao[a]>b) {b=miao[a];c=a;}
}
printf("%c\n%d\n",c+65,b);
w=(c+65);
for(i=0;i<m;i++)
{
for(j=0;kk[i][j]!='\0';j++)
{
if(kk[i][j]==w) {printf("%d\n",tt[i]);break;}
}
}
} | 2 |
682 | int main()
{
int k;
cin>>k;
int book;
char writer[26];
int counter[26]={0};
int bookbelong[26][999]={0};
int everynum[26]={0};
int t=0;
while(k--)
{
cin>>book>>writer;
int str=strlen(writer);
for(int i=0;i<str;i++)
{
int flag=writer[i]-'A';
counter[flag]++;
bookbelong[flag][everynum[flag]++]=book;
}
}
int max=counter[0];
int maxnum=0;
for(int i=0;i<26;i++)
{
if(counter[i]>max)
{
maxnum=i;
max=counter[i];
}}
char writerbest;
writerbest='A'+maxnum;
cout<<writerbest<<endl<<everynum[maxnum]<<endl;
for(int i=0;i<everynum[maxnum];i++)
cout<< bookbelong[maxnum][i]<<endl;
return 0;
}
| 2 |
683 | int main()
{
int n,i,a[2000],max=0,t,b[30]={0},j,m;
char str[1000][30];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d %s",&a[i],str[i]);
for(j=0;j<strlen(str[i]);j++){
m=str[i][j]-64;
b[m]++;
}
}
for(i=1;i<26;i++)if(b[i]>max){
max=b[i];
t=i;
}
printf("%c\n%d\n",t+64,max);
for(i=0;i<n;i++){
for(j=0;j<strlen(str[i]);j++)
if(str[i][j]==t+64)printf("%d\n",a[i]);
}
return 0;
}
| 2 |
684 |
int main()
{
int bookno[100];
char author[100][26];
int numOfauthor[26] = {0};
int nbook, max = 0, maxno;
char maxauthor;
cin >> nbook;
int i, j;
for ( i = 0; i < nbook; i ++)
{
cin >> bookno[i];
cin.get();
cin.getline(*(author + i), 26);
}
for ( i = 0; i < nbook; i ++)
for ( j = 0; author[i][j] !='\0'; j ++)
{
numOfauthor[author[i][j] - 'A'] ++;
}
for ( i = 0; i < 26; i ++)
{
if ( numOfauthor[i] > max)
{
max = numOfauthor[i];
maxno = i;
}
}
maxauthor = maxno + 'A';
cout << maxauthor << endl;
cout << numOfauthor[maxno] << endl;
for ( i = 0; i < nbook; i ++)
for ( j = 0; author[i][j] != '\0'; j ++)
{
if ( author[i][j] == maxauthor )
cout << bookno[i] << endl;
}
return 0;
}
| 2 |
685 | int main()
{ struct s
{int N;
char w[26];
};
struct s s[999];
int n,i,j,c,a[26];
scanf("%d\n",&n);
for (i=0;i<=(n-1);i++)
{ scanf("%d",&s[i].N);
gets(s[i].w);
}
for (i=0;i<=(n-1);i++)
{ for (j=0;j<=25;j++)
{ c=s[i].w[j];
a[c-65]++;
}
}
c=0;
for (i=0;i<=25;i++)
{ if (a[c]<a[i]) c=i;
}
printf("%c\n%d\n",c+65,a[c]);
for (i=0;i<=(n-1);i++)
{ for (j=0;j<=25;j++)
if (s[i].w[j]==(c+65)) printf("%d\n",s[i].N);
}
} | 2 |
686 | struct BOOK{
int id;
int author[26];
};
int main(){
struct BOOK book[1000];
int countauthor[26];
int n,i,j,minusA,no,count,max=0,maxau;
char input[30];
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<26;j++){
book[i].author[j]=0;
}
}// refresh data: each book-->all authors initiate with 0
for(i=0;i<n;i++){
scanf("%d",&book[i].id);
scanf("%s",&input);
no=strlen(input);
for(j=0;j<no;j++){
minusA=(input[j]-'A');
book[i].author[minusA]++;
}
}
for(i=0;i<26;i++){
count=0;
for(j=0;j<n;j++){
if(book[j].author[i]==1)
count++;
}
countauthor[i]=count;
}
for(i=0;i<26;i++){
if(max<countauthor[i])
max=countauthor[i];
}// to find max
for(i=0;i<26;i++){
if(countauthor[i]==max)
maxau=i;
}//to find which author has maximum number of book
printf("%c\n%d\n",(maxau+'A'),max);
for(i=0;i<n;i++){
if(book[i].author[maxau]==1){
printf("%d\n",book[i].id);
}
}
return 0;
} | 2 |
687 | struct{
int location[1001];
int num;
int sum;
}ans[27];
int main()
{
int n,value=-1,order,m;
char s[28];
cin>>n;
for(int i=1;i<=26;i++)
{
ans[i].num=ans[i].sum=0;
}
for(int i=1;i<=n;i++)
{
cin>>m;
cin>>s;
for(int j=0;j<strlen(s);j++)
{
ans[s[j]-'A'+1].num++;
ans[s[j]-'A'+1].sum++;
ans[s[j]-'A'+1].location[ans[s[j]-'A'+1].num]=m;
}
}
for(int i=1;i<=26;i++)
if(ans[i].sum>value)
{
value=ans[i].sum;
order=i;
}
cout<<(char)(order+'A'-1)<<endl;
cout<<ans[order].num<<endl;
for(int i=1;i<=ans[order].num;i++)
cout<<ans[order].location[i]<<endl;
return 0;
}
| 2 |
688 | main()
{
int n,i,a,t,d[26]={0},f=0,c,h,e=0;
struct book
{
int N;
char name[20];
}p[1000];
scanf("%d",&n);
for(i=0;i<=n-1;i++)
scanf("%d %s",&p[i].N,p[i].name);
for(i=0;i<=n-1;i++)
{
a=strlen(p[i].name);
for(t=0;t<=a-1;t++)
{
c=p[i].name[t]-'A';
d[c]++;
}
}
for(i=0;i<=25;i++)
{
if (e<d[i])
{
e=d[i];
f=i;
}
}
h=f+'A';
printf("%c\n%d\n",h,e);
for(i=0;i<=n-1;i++)
{
a=strlen(p[i].name);
for(t=0;t<=a-1;t++)
{
if(p[i].name[t]==h)
{
printf("%d\n",p[i].N);
break;
}
}
}
} | 2 |
689 | //#define NULL 0
struct stu
{
int num;
char c[26];
struct stu *next;
};
struct stu* create(int m)
{
struct stu *p1,*p2,*xhead;
p1=(struct stu *)malloc(LEN);
scanf("%d %s",&p1->num,p1->c);
p2=p1;
xhead=p1;
while(m-1)
{
m--;
p1=(struct stu*)malloc(LEN);
scanf("%d %s",&p1->num,p1->c);
p2->next=p1;
p2=p1;
}
p2->next=NULL;
return xhead;
}
int stas(int b[])
{
int j,max=0,indexx=0;
for(j=0;j<26;j++)
if(b[j]>max)
{
max=b[j];
indexx=j;
}
printf("%c\n%d\n",indexx+65,max);
//for(j=0;j<26;j++)
//printf("%d ",b[j]);
return indexx;
}
struct stu* search(struct stu* yhead,int y)
{
struct stu *q;
int sum=0,k;
char *i;
char s[20],s0[20]={'\0'};
q=yhead;
while(q)
{
strcpy(s,q->c);
k=strlen(s);
for(i=s;i<i+k;i++)
if(*i==y+65)
sum++;
strcpy(s,s0);
q=q->next;
}
printf("%d\n",sum);
return 0;
}
struct stu* print(struct stu* zhead,int z)
{
struct stu* q;
int k;
char *i;
char s[20],s0[20]={'\0'};
q=zhead;
while(q)
{
strcpy(s,q->c);
k=strlen(s);
for(i=s;i<s+k;i++)
if(*i==z+65)
{
printf("%d\n",q->num);
break;
}
strcpy(s,s0);
q=q->next;
}
return 0;
}
int main()
{
int n,index;
int a[26],k,t,i;
char s[20],s0[20]={'\0'};
struct stu *p,*head;
memset(a,0,sizeof(a));
scanf("%d",&n);
head=create(n);
p=head;
while(p)
{
strcpy(s,p->c);
//printf("%s ",s);
k=strlen(s);
//printf("%d ",k);
for(i=0;i<k;i++)
{
//printf("%c ",s[i]);
t=s[i]-65;
a[t]++;
}
//for(t=0;t<26;t++)
//printf("%d ",a[t]);
strcpy(s,s0);
p=p->next;
}
index=stas(a);
//search(head,index);
print(head,index);
return 0;
}
| 2 |
690 | /*
* 1.cpp
*
* Created on: 2013-1-13
* Author: Administrator
*/
int main()
{
int n, i, j, max = 0, maxi = 0;
int a[1100] = {0}, b[30] = {0}, c[30][1100] = {0};
char zz[1100][30];
cin >> n;
for(i = 1; i <= n; i++)
{
cin >> a[i] >> zz[i];
for(j = 0; zz[i][j] != '\0'; j++)
{
b[(int)zz[i][j] - 'A']++;
c[(int)zz[i][j] - 'A'][i] = 1;
}
}
for(i = 0; i <= 25; i++)
{
if(b[i] > max)
{
max = b[i];
maxi = i;
}
}
cout << (char)(maxi + 'A') << endl;
cout << max << endl;
for(i = 1; i <= 1000; i++)
{
if(c[maxi][i] == 1)
cout << a[i] << endl;
}
return 0;
}
| 2 |
691 |
struct list
{
int num;
char author[26];
};
struct number
{
int a;
int time;
};
int main()
{
int i,j,m,k,length;
struct list book[100];
struct number name[26],most;
scanf("%d",&m);
for(i=0;i<m;i++)
{
scanf("%d %s",&book[i].num,book[i].author);
}
for(i=0;i<26;i++)
{
name[i].a=i;
name[i].time=0;
}
for(i=0;i<m;i++)
{
length=strlen(book[i].author);
for(j=0;j<length;j++)
{
k=(book[i].author[j]);
name[k-65].time++;
}
}
most=name[0];
for(i=1;i<26;i++)
{
if(name[i].time>most.time){
most=name[i];
}
}
printf("%c\n%d\n",most.a+65,most.time);
for(i=0;i<m;i++)
{
length=strlen(book[i].author);
for(j=0;j<length;j++)
{
k=(book[i].author[j]);
if(most.a+65==k){
printf("%d\n",book[i].num);
}
}
}
return 0;
}
| 2 |
692 | struct book
{
int num;
char zz[32];
struct book *next;
};
struct book *creat(int n)
{
struct book *head,*p1,*p2;
int i;
p1=p2=(struct book *)malloc(LEN);
scanf("%d %s",&p1->num,p1->zz);
head=NULL;
for(i=0;i<n-1;i++)
{
if(i==0) head=p1;
else p2->next=p1;
p2=p1;
p1=(struct book *)malloc(LEN);
scanf("%d %s",&p1->num,p1->zz);
}
p2->next=p1;
p1->next=NULL;
return (head);
}
void search(struct book *head,int n)
{
int *p[26],i,j;
struct book *q=head;
for(i=0;i<26;i++)
{
p[i]=(int *)malloc(sizeof(int));
*p[i]=0;
}
for(i=0;i<n;i++)
{
for(j=0;(q->zz)[j]!='\0';j++)
{
(*p[(q->zz)[j]-'A'])++;
}
q=q->next;
}
q=head;
int max=*p[0],k=0;
for(i=1;i<26;i++)
{if(*p[i]>max){max=*p[i];k=i;}}
printf("%c\n%d",'A'+k,max);
for(i=0;i<n;i++)
{
for(j=0;(q->zz)[j]!='\0';j++)
{
if((q->zz)[j]=='A'+k)
printf("\n%d",q->num);
}
q=q->next;
}
}
void main()
{
int n;
scanf("%d",&n);
struct book *head;
head=creat(n);
search(head,n);
} | 2 |
693 | void main()
{
int m,i,j,temp,max;
char a[1000][10],b[1000][20],w;
int c[26];
scanf("%d",&m);
for(i=0;i<26;i++) c[i]=0;
for(i=0;i<m;i++)
{
scanf("%s %s",a[i],b[i]);
}
for(i=0;i<m;i++)
{
for(j=0;j<strlen(b[i]);j++)
{
if(b[i][j]=='A') c[0]++;
if(b[i][j]=='B') c[1]++;
if(b[i][j]=='C') c[2]++;
if(b[i][j]=='D') c[3]++;
if(b[i][j]=='E') c[4]++;
if(b[i][j]=='F') c[5]++;
if(b[i][j]=='G') c[6]++;
if(b[i][j]=='H') c[7]++;
if(b[i][j]=='I') c[8]++;
if(b[i][j]=='J') c[9]++;
if(b[i][j]=='K') c[10]++;
if(b[i][j]=='L') c[11]++;
if(b[i][j]=='M') c[12]++;
if(b[i][j]=='N') c[13]++;
if(b[i][j]=='O') c[14]++;
if(b[i][j]=='P') c[15]++;
if(b[i][j]=='Q') c[16]++;
if(b[i][j]=='R') c[17]++;
if(b[i][j]=='S') c[18]++;
if(b[i][j]=='T') c[19]++;
if(b[i][j]=='U') c[20]++;
if(b[i][j]=='V') c[21]++;
if(b[i][j]=='W') c[22]++;
if(b[i][j]=='X') c[23]++;
if(b[i][j]=='Y') c[24]++;
if(b[i][j]=='Z') c[25]++;
}
}
for(i=0;i<26;i++)
{ temp=0;
for(j=0;j<26;j++)
{
if(c[i]>=c[j])
{
temp++;
}
}
if(temp==26) {max=i;break;}
}
w='A'+i;
printf("%c\n",w);
printf("%d\n",c[i]);
for(i=0;i<m;i++)
{
for(j=0;j<strlen(b[i]);j++)
{
if(b[i][j]==w) {printf("%s\n",a[i]);break;}
}
}
} | 2 |
694 | typedef char q[30];
void init(int a[],int f[],q *p[lll],int m)
{
int i;
char e[432];
char *pp;
int r;
for(i=1;i<=m;i++)
{
p[i]=(q *)malloc(sizeof(q));
scanf("%d%s",&f[i],p[i]);
getchar();
pp=*p[i];
while (*pp!='\0')
{a[*pp]++;
pp++;
}
}
}
char pro(int a[])
{
char c,max,g;
max=-333;
for (c='A';c<='Z';c++)
if (a[c]>max) {max=a[c];g=c;}
return g;
}
void print(int f[],q *p[lll],int m,char c)
{
int i;
for (i=1;i<=m;i++)
if (strchr(*p[i],c)!=NULL) printf("%d\n",f[i]);
}
int main()
{
int m,k;
int a[343]={0};
int f[lll];
q *p[lll];
char max;
//freopen("tt.in","r",stdin);
//freopen("tt.out","w",stdout);
scanf("%d",&m);
init(a,f,p,m);
max=pro(a);
printf("%c\n%d\n",max,a[max]);
print(f,p,m,max);
}
| 2 |
695 | void main()
{
int a[100],i,l,c[26]={0},k,max,n,j;
char b[100][26],d[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d %s",&a[i],b[i]);
for(i=0;i<n;i++)
{
l=strlen(b[i]);
for(j=0;j<l;j++)
{
if(b[i][j]=='A')
c[0]++;
else if(b[i][j]=='B')
c[1]++;
else if(b[i][j]=='C')
c[2]++;
else if(b[i][j]=='D')
c[3]++;
else if(b[i][j]=='E')
c[4]++;
else if(b[i][j]=='F')
c[5]++;
else if(b[i][j]=='G')
c[6]++;
else if(b[i][j]=='H')
c[7]++;
else if(b[i][j]=='I')
c[8]++;
else if(b[i][j]=='J')
c[9]++;
else if(b[i][j]=='K')
c[10]++;
else if(b[i][j]=='L')
c[11]++;
else if(b[i][j]=='M')
c[12]++;
else if(b[i][j]=='N')
c[13]++;
else if(b[i][j]=='O')
c[14]++;
else if(b[i][j]=='P')
c[15]++;
else if(b[i][j]=='Q')
c[16]++;
else if(b[i][j]=='R')
c[17]++;
else if(b[i][j]=='S')
c[18]++;
else if(b[i][j]=='T')
c[19]++;
else if(b[i][j]=='U')
c[20]++;
else if(b[i][j]=='V')
c[21]++;
else if(b[i][j]=='W')
c[22]++;
else if(b[i][j]=='X')
c[23]++;
else if(b[i][j]=='Y')
c[24]++;
else if(b[i][j]=='Z')
c[25]++;
}
}
max=c[0];
for(i=0;i<26;i++)
if(c[i]>=max)
{
max=c[i];
k=i;
}
printf("%c\n",d[k]);
printf("%d\n",c[k]);
for(i=0;i<n;i++)
{
l=strlen(b[i]);
for(j=0;j<l;j++)
{
if(b[i][j]==d[k])
printf("%d\n",a[i]);
}
}
} | 2 |
696 | int alpha[26]={0};
struct library
{
int num;
char authors[27];
}books[999];
void addauthor(char string[])
{
int i=0;
do
{ alpha[string[i]-'A']++;
i++;
}
while(string[i]!='\0');
}
void hewroteit(struct library book,int maxalpha)
{
int i;
for(i=0;book.authors[i]!='\0';i++)
{
if(book.authors[i]-'A'==maxalpha)
{
printf("%d\n",book.num);
break;
}
}
}
int main()
{
int m;
scanf("%d",&m);
int i;
for(i=0;i<m;i++)
scanf("%d %s",&books[i].num,books[i].authors);
for(i=0;i<m;i++)
addauthor(books[i].authors);
int max=0,maxalpha=0;
for(i=0;i<26;i++)
{
if (alpha[i]>max)
{
max=alpha[i];
maxalpha=i;
}
}
printf("%c\n%d\n",'A'+maxalpha,max);
for(i=0;i<m;i++)
{
hewroteit(books[i],maxalpha);
}
return 0;
}
| 2 |
697 | int main()
{
int booknumber;
int order[1000];
char author[1000][27];
char single_author[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
int author_booknumber[26]={0};
int i,j,k;
int tmp;
scanf("%d",&booknumber);
for(i=0;i<booknumber;i++)
{
scanf("%d%s",&order[i],author[i]);
for(j=0;j<strlen(author[i]);j++)
{
for(k=0;k<26;k++)
{
if(author[i][j]==single_author[k])
{
author_booknumber[k]++;
break;
}
}
}
}
tmp=0;
for(i=1;i<26;i++)
{
if(author_booknumber[i]>author_booknumber[tmp])
tmp=i;
}
printf("%c\n",single_author[tmp]);
printf("%d\n",author_booknumber[tmp]);
for(i=0;i<booknumber;i++)
{
for(j=0;j<strlen(author[i]);j++)
{
if(author[i][j]==single_author[tmp])
{
printf("%d\n",order[i]);
break;
}
}
}
return 0;
}
| 2 |
698 | struct book
{
int ID;
char author[30];
struct book *next;
};
int n,max=0;
char c;
int num[26]={0};
struct book *create()
{
struct book *head,*p1,*p2;
p1=(struct book*)malloc(LEN);
scanf("%d %s",&p1->ID,p1->author);
head=p1;
p2=p1;
p1->next=NULL;
int i=1;
do
{
if(i==n)break;
p1=(struct book*)malloc(LEN);
scanf("%d %s",&p1->ID,p1->author);
p2->next=p1;
p2=p1;
p1->next=NULL;
i++;
}while(1);
return(head);
}
void seek(struct book *head)
{
struct book *p;
char *s;
p=head;
while(p)
{
for(s=p->author;*s!='\0';s++)
{
int temp;
temp=*s-'A';
(*(num+temp))++;
}
p=p->next;
}
}
void find(struct book *head)
{
struct book *p;
char *s;
p=head;
while(p)
{
for(s=p->author;*s!='\0';s++)
{
if(*s==c)break;
}
if(*s!='\0')printf("%d\n",p->ID);
p=p->next;
}
}
int main()
{
struct book *head;
int i;
scanf("%d",&n);
head=create();
seek(head);
for(i=0;i<26;i++)
{
if(*(num+i)>max)max=*(num+i);
}
for(i=0;i<26;i++)
{
if(*(num+i)==max)break;
}
printf("%c\n%d\n",'A'+i,max);
c='A'+i;
find(head);
}
| 2 |
699 |
struct book
{
int num;
char *name;
struct book *next;
}
main()
{
int n,i;
scanf("%d",&n);
struct book *p1,*p2,*head;
p1=len;
head=p1;
for(i=0;i<n;i++)
{
p1->name=(char *)malloc(26*1);
scanf("%d %s",&p1->num,p1->name);
p2=len;
p1->next=p2;
p1=p2;
}
p1=p2=head;
int *a;
a=(int *)malloc(26*4);
for(i=0;i<26;i++)
*(a+i)=0;
int j;
int l;
for(i=0;i<n;i++)
{
j=0;
while(*(p1->name+j)!='\0')
{
l=*(p1->name+j)-'A';
*(a+l)+=1;
j+=1;
}
p1=p1->next;
}
int max=0,maxl;
for(i=0;i<26;i++)
if(*(a+i)>max)
{
max=*(a+i);
maxl='A'+i;
}
printf("%c\n%d\n",maxl,max);
p1=p2=head;
for(i=0;i<n;i++)
{
j=0;
while(*(p1->name+j)!='\0')
{
if(*(p1->name+j)==maxl)
{
printf("%d\n",p1->num);
break;
}
j+=1;
}
p1=p1->next;
}
} | 2 |