链接:http://hihocoder.com/problemset/problem/1223
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;
char s[1010][100];
int a[100];
int main()
{
int n;
while(~scanf("%d",&n))
{
char ch[2];
getchar();
memset(s,'\0',sizeof(s));
for(int i=0;i<n;i++)
{
scanf("%s%s%d",ch,s[i],&a[i]) ;
}
int temp=0;
for(float i=-1;i<=1001;i+=0.5)
{
int cnt=0;
for(int k=0;k<n;k++)
{
if(strcmp(s[k],"=")==0)
{
if(i==a[k])
cnt++;
}
else if(strcmp(s[k],">")==0)
{
if(i>a[k])
cnt++;
}
else if(strcmp(s[k],"<")==0)
{
if(i<a[k])
cnt++;
}
else if(strcmp(s[k],">=")==0)
{
if(i>=a[k])
cnt++;
}
else if(strcmp(s[k],"<=")==0)
{
if(i<=a[k])
cnt++;
}
}
if(cnt>temp)
temp=cnt;
}
printf("%d\n",temp);
}
return 0;
}