{"id":36699,"date":"2016-04-30T21:04:41","date_gmt":"2016-05-01T02:04:41","guid":{"rendered":"http:\/\/everolivares.wordpress.com\/?p=243"},"modified":"2016-04-30T21:11:06","modified_gmt":"2016-05-01T02:11:06","slug":"wsq11-yo-soy-192","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101winter2016\/2016\/04\/wsq11-yo-soy-192\/","title":{"rendered":"#WSQ11-Yo soy 192"},"content":{"rendered":"<p>This one in particular was a challenge&#8230; but with help everything is possible. Also for this WSQ I had to &#8220;add&#8221; a new library so I could work with bigger numbers it is called\u00a0&#8220;BigIntegerLibrary.hh&#8221;.<\/p>\n<p>\/\/CODE<\/p>\n<p>#include &lt;iostream&gt;<br \/>\n#include &lt;string&gt;<br \/>\n#include &#8220;BigIntegerLibrary.hh&#8221;<br \/>\nusing namespace std;<\/p>\n<p>BigInteger lychrel (BigInteger x){<\/p>\n<p>string y = bigIntegerToString(x);<br \/>\nlychrel(y.begin(), y.end());<br \/>\nBigInteger lychrel = stringToBigInteger(y);<br \/>\nreturn lychrel;<br \/>\n}<\/p>\n<p>int main() {<br \/>\nint low,up,number,j,k,p=0;<br \/>\nint l=0, n=0;<br \/>\nBigInteger z,count=0, sum=0;<\/p>\n<p>cout &lt;&lt; &#8220;Give me the lower bound&#8221;;<br \/>\ncin&gt;&gt;low;<\/p>\n<p>cout&lt;&lt; &#8220;Give me the upper bound&#8221;;<br \/>\ncin&gt;&gt;up;<\/p>\n<p>for(count=low;count&lt;=up;count++){<br \/>\nfor(BigInteger i=count; i&lt;=count;i++){<\/p>\n<p>z= lychrel(i); sum=y+count;}<\/p>\n<p>if(count==z) {<br \/>\nn=n+1;<br \/>\n} else {<br \/>\nint times= 0;<\/p>\n<p>BigInteger zeit = count;<br \/>\nz=lychrel(zeit);<\/p>\n<p>while(zeit != z &amp;&amp; times &lt; 30){<\/p>\n<p>zeit = zeit + z;<br \/>\nz = lychrel(zeit);<br \/>\ntimes=times+1;<br \/>\n}<br \/>\nif(times &lt; 30){<br \/>\np = p + 1;<br \/>\n} else {<br \/>\ncout &lt;&lt; &#8220;Lychrel found &#8221; &lt;&lt; count &lt;&lt; endl;<br \/>\nl = l +1;<br \/>\n}<br \/>\n}<br \/>\n}<\/p>\n<p>cout &lt;&lt;&#8220;The palindrom is: &#8221; &lt;&lt; n &lt;&lt;endl;<br \/>\ncout&lt;&lt;&#8220;Lychrel doesn&#8217;t become palindrome in: &#8220;&lt;&lt; p &lt;&lt;endl;<br \/>\ncout&lt;&lt;&#8220;The lychrel is: &#8220;&lt;&lt; l &lt;&lt;endl;<\/p>\n<p>return 0;<br \/>\n}<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-250\" src=\"http:\/\/kenscourses.com\/tc101winter2016\/wp-content\/uploads\/2016\/04\/bb6cc03685fb48779aef80d52a59bc5c.jpg\" alt=\"Captura de pantalla 2016-04-30 a las 21.04.04\"   \/><img decoding=\"async\" class=\"alignnone size-full wp-image-251\" src=\"http:\/\/kenscourses.com\/tc101winter2016\/wp-content\/uploads\/2016\/04\/110f8477e2fd026fb0c59b3346f9e06f.jpg\" alt=\"Captura de pantalla 2016-04-30 a las 21.04.09\"   \/><\/p>\n<p>  <a rel=\"nofollow\" href=\"http:\/\/feeds.wordpress.com\/1.0\/gocomments\/everolivares.wordpress.com\/243\/\"><img decoding=\"async\" alt=\"\" border=\"0\" src=\"http:\/\/kenscourses.com\/tc101winter2016\/wp-content\/uploads\/2016\/04\/f59ee7ed39b23a682293753218a2a957.jpg\" \/><\/a> <img loading=\"lazy\" decoding=\"async\" alt=\"\" border=\"0\" src=\"http:\/\/kenscourses.com\/tc101winter2016\/wp-content\/uploads\/2016\/04\/8ca8bfedf7c2ca1550797b17d22a00b9.jpg#038;blog=105236756&#038;%23038;post=243&#038;%23038;subd=everolivares&#038;%23038;ref=&#038;%23038;feed=1\" width=\"1\" height=\"1\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This one in particular was a challenge&#8230; but with help everything is possible. Also for this WSQ I had to &#8220;add&#8221; a new library so I could work with bigger numbers it is called\u00a0&#8220;BigIntegerLibrary.hh&#8221;. \/\/CODE #include &lt;iostream&gt; #include &lt;string&gt; #include &#8220;BigIntegerLibrary.hh&#8221; using namespace std; BigInteger lychrel (BigInteger x){ string y = bigIntegerToString(x); lychrel(y.begin(), y.end()); BigInteger &hellip; <a href=\"https:\/\/kenscourses.com\/tc101winter2016\/2016\/04\/wsq11-yo-soy-192\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">#WSQ11-Yo soy 192<\/span><\/a><\/p>\n","protected":false},"author":58,"featured_media":36708,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[25],"class_list":["post-36699","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogs","category-syndicated","tag-uncategorized"],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/posts\/36699","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/users\/58"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/comments?post=36699"}],"version-history":[{"count":2,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/posts\/36699\/revisions"}],"predecessor-version":[{"id":36714,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/posts\/36699\/revisions\/36714"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/media\/36708"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/media?parent=36699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/categories?post=36699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/tags?post=36699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}