//2054
#include <iostream>
#include <string>
using namespace std;
void func(char* s)
{
int len = strlen(s);
char* p = s + len - 1;
if (strchr(s, '.'))
{
while (*p == '0') *p-- ;//去掉后导0
if (*p == '.') *p = 0;
}
}
int main()
{
char* pa, * pb;
char a[100000], b[100000];
while (cin >> a >> b)
{
pa = a, pb = b;
while (*pa == '0')*pa++;
while (*pb == '0')*pb++;
func(pa); func(pb);
if (!strcmp(pa, pb))
puts("YES");
else
puts("NO");
}
return 0;
}
hdu 2054 A==B?
最新推荐文章于 2024-07-25 12:39:48 发布