#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
int n;
while(~scanf("%d\n",&n))
{
int ans[6]={0,0,0,0,0,0};
while(n–)
{
char in[7];
gets(in);
switch(in[0])
{
case ‘g’:
ans[0]++;
break;
case ‘r’:
ans[1]++;
break;
case ‘p’:
ans[3]++;
break;
case ‘o’:
ans[4]++;
break;
default:
if(in[2]==‘u’)
ans[2]++;
else
ans[5]++;
break;
}
}
int mark,i;
for(mark=i=0; i<6; i++)
if(ans[mark]<ans[i])
mark=i;
char word[10];
switch(mark)
{
case 0:strcpy(word,“green\n”);break;
case 1:strcpy(word,“red\n”);break;
case 2:strcpy(word,“blue\n”);break;
case 3:strcpy(word,“pink\n”);break;
case 4:strcpy(word,“orange\n”);break;
case 5:strcpy(word,“black\n”);break;
}
printf("%s",word);
}
return 0;
}
#include <stdio.h>
#include <stdlib.h>
int main()
{
char sentence[100];
while(gets(sentence)!=NULL)
{
int k=0,j=0,i;
char word[100][10];
for(i=0; sentence[i]!=’\0’; i++)
{
if(
(sentence[i]’ ')+
(sentence[i]’,’)+
(sentence[i]’.’)+
(sentence[i]’!’)+
(sentence[i]’?’)+
(sentence[i]’’’)+
(sentence[i]==’-’)
)
{
word[k][j]=’\0’;
k++;
j=0;
word[k][0]=’\0’;
}
else
{
word[k][j]=sentence[i];
j++;
}
}
for(i=0; i<k; i++)
{
if(word[i][0]!=’\0’)
{
puts(word[i]);
}
}
}
return 0;
}
#include <stdio.h>
#include <stdlib.h>
int main()
{
int m,n;
double Num[10][10];
while(~scanf("%d%d",&m,&n))
{
int i,j;
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
scanf("%lf",&Num[i][j]);
}
}
double ans=Num[0][0];
int x=0,y=0;
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
if(ans<Num[i][j])
ans=Num[i][j],x=i,y=j;
}
}
printf("%.2lf %d %d\n",ans,x+1,y+1);
}
return 0;
}
#include <stdio.h>
#include <stdlib.h>
double *ans(double **Num,int m,int n)
{
double *ans;
ans=(double *)malloc(sizeof(double)*3);
ans=*Num;
*(ans+1)=0;
(ans+2)=0;
int i,j;
for(i=0; i<m; i++)
{
for(j=0; j<n; j++)
{
if(ans<Num[i][j])
ans=&Num[i][j],(ans+1)=i,(ans+2)=j;
}
}
return ans;
}
int main()
{
int m,n;
double Num[10][10];
while(~scanf("%d%d",&m,&n))
{
int i,j;
for(i=0; i<m; i++)
{
for(j=0; j<n; j++)
{
scanf("%lf",&Num[i][j]);
}
}
double a[3];
a=ans(Num,m,n);
printf("%.2lf %.lf %.lf\n",a,(a+1),*(a+2));
}
return 0;
}