#include <stdio.h>
#include <string.h>
Char n[100000], m[100000];
int main ()
{
int I, J, Len_n, Len_m, Flag, Len_last, Len_late,doc, Q, p, count, start;
Char ch;
while (1)
{
memset (n, 0, sizeof (n));
memset (m, 0, sizeof (m));
Flag = i = j = doc = Count = start = 0;
while (1)
{
if (scanf ("%c", &ch) = = EOF) return 0;
if (ch = = ' \ n ' && start = = 1) break;
else if (ch! = ' ' && ch! = ' \ n ' && flag = = 0)
{
n[i++] = ch;
}
else if (ch = = ' | | | ch = = ' \ n ')
{
flag = 1;
start = 1;
}
else m[j++] = ch;
}
Len_n = strlen (n);
Len_m = strlen (m);
if ((n[0] = = '-' && m[0]! = '-') | | (n[0]! = '-' && m[0] = = '-'))
{
printf ("no\n");
continue;
}
for (i = n[0]! = '-'? 0:1; i<len_n && n[i]-' 0 ' = = 0; i++;
for (j = m[0]! = '-'? 0:1; j<len_m && m[j]-' 0 ' = = 0; j + +);
Len_n-= i;
Len_m-= j;
Len_last = Len_n < len_m? len_n:len_m;
Len_late = Len_n + len_m-len_last;
{
for (; count < Len_last; i++, j + +, count++)
if (n[i]-' 0 '! = m[j]-' 0 ') break;
Else if (n[i] = = '. ') doc = 1;
if (Count >= len_late)
{
printf ("yes\n");
}
Else
{
if (Len_n > Len_m)
{
if (doc! = 1 && n[i]! = '. ') printf ("no\n");
Else
{
for (i = n[i] = = '. '? i+1:i; I<strlen (n); i++)
if (n[i]-' 0 '! = 0) break;
if (i>=len_n) printf ("yes\n");
else printf ("no\n");
}
}
else if (Len_n < len_m)
{
if (Doc! = 1 && m[j]! = '. ') printf ("no\n");
Else
{
for (j = m[j] = = '. '? J+1:j; J<strlen (m); j + +)
if (M[j]-' 0 '! = 0) break;
if (j>=len_m) printf ("yes\n");
else printf ("no\n");
}
}
else if (len_n = = len_m) printf ("no\n");
}
}
}
return 0;
}
1. Consider the 0 in front of the number
2. Consider the 0 after the decimal point
3. Consider large numbers
HDU-2054 a==b?