hdu2054 A == B ?

发布时间:2024-11-21 14:39

记住"CPR"(心肺复苏)的口诀:"C-A-B,先C再A后B" #生活技巧# #紧急应对技巧# #医疗急救电话#

最新推荐文章于 2021-02-24 00:30:01 发布

kgduu 于 2012-05-20 01:14:54 发布

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

#include <iostream>

#include <string>

#include <algorithm>

#include <fstream>

using namespace std;

void del(string &str);

int main()

{

string a, b;

#ifndef ONLINE_JUDGE

ifstream cin("d:\\UVa\\uva_in.txt");

#endif

while (cin >> a >> b)

{

del(a);

del(b);

if (a == b)

cout << "YES" << endl;

else

cout << "NO" << endl;

}

return 0;

}

void del(string &str)

{

string::iterator it;

int flag = 0;

for (it = str.begin(); it != str.end(); it++)

{

if (*it == '0')

{

str.erase(it);

it--;

}

else

break;

}

for (it = str.begin(); it != str.end(); it++)

if (*it == '.')

{

flag = 1;

break;

}

if (flag)

{

reverse(str.begin(), str.end());

for (it = str.begin(); it != str.end(); it++)

{

if (*it == '0')

{

str.erase(it);

it--;

}

else

break;

}

it = str.begin();

if (*it == '.')

str.erase(it);

reverse(str.begin(), str.end());

}

}


网址:hdu2054 A == B ? https://www.yuejiaxmz.com/news/view/175107

相关内容

int a=3,b=2,c=1; if(a>b && b&
a²=a+1,b²=b+1,求根号下的式子
R(A+B)<=R(A)+R(B): R(AB)<=min(R(A)+R(B)): A为m×n矩阵,r(A)=n,则AX=0只有零解。设矩阵A为m×n的秩R(A)=m;Ax=b 有解;
定义运算a⊕b=a(1
定义符号min{a.b}的含义为:当a≥b时.min{a.b}=b,当a<b时.min{a.b}=a.如:min{2.
证明布尔等式A+A‘B=A+B
已知集合 A = 0, 3, x ,B = 0,1 ,若 B ⊆ A,则 x =
figsize = (a, b)
一道数学求值题若a,b,c是两两不相等实数,其中a是b和c的等比中项,b是a和c的等差中项,则(a/b)+(c/a)=?请写出推导过程
设关系模式R(A,B,C),F是R上成立的FD集,F={B→A,B→C},则分解

随便看看