tag:blogger.com,1999:blog-8522573717713847738.post6921922202186598918..comments2024-03-28T00:14:29.070-07:00Comments on Yu's Coding Garden : leetcode Question: Largest NumberAnonymoushttp://www.blogger.com/profile/00263085222060621782noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-8522573717713847738.post-37223244094032283552016-04-07T11:44:34.892-07:002016-04-07T11:44:34.892-07:00i cant understand the same thing..the following wo...i cant understand the same thing..the following works very well for me though<br />string s1,s2;<br /> s1=to_string(a)+to_string(b);<br /> s2=to_string(b)+to_string(a);<br /> <br /> if(s1>s2)<br /> return true;<br /> else<br /> return false;Anonymoushttps://www.blogger.com/profile/14739599558525902942noreply@blogger.comtag:blogger.com,1999:blog-8522573717713847738.post-83966300511120886602016-04-07T11:42:02.648-07:002016-04-07T11:42:02.648-07:00i think to_string does cause some issues....it had...i think to_string does cause some issues....it had some issues with some versions of codeblocks and eclipse c++.. <br />http://stackoverflow.com/questions/19893922/c11-to-string-to-working-with-codeblocks-std-c11-flag-already-selectedAnonymoushttps://www.blogger.com/profile/14739599558525902942noreply@blogger.comtag:blogger.com,1999:blog-8522573717713847738.post-17811830837406697782015-11-02T12:15:40.799-08:002015-11-02T12:15:40.799-08:00sa = sa + sb;
sb = sb + sa;
sa is being appended i...sa = sa + sb;<br />sb = sb + sa;<br />sa is being appended in the latter line so final sb = sb+sa+sb acc. to what is written.lynxworldhttps://www.blogger.com/profile/06195627836755568844noreply@blogger.comtag:blogger.com,1999:blog-8522573717713847738.post-75914466310046701952015-09-09T08:57:32.072-07:002015-09-09T08:57:32.072-07:00here, why have we used stringstream, will a simple...here, why have we used stringstream, will a simple to_string(0 lead to problems?<br />draculhttps://www.blogger.com/profile/02468326744226167172noreply@blogger.com