{"id":621,"date":"2010-10-13T17:02:24","date_gmt":"2010-10-13T17:02:24","guid":{"rendered":"http:\/\/cncodingdojo.wordpress.com\/?p=343"},"modified":"2010-11-17T16:44:28","modified_gmt":"2010-11-17T18:44:28","slug":"kata-10-adding-reversed-numbers","status":"publish","type":"post","link":"https:\/\/blog.cancaonova.com\/desenvolvimentoti\/kata-10-adding-reversed-numbers\/","title":{"rendered":"Coding Dojo #10 Adding Reversed\u00a0Numbers"},"content":{"rendered":"<p>Mais um Dojo finalizado. Dessa vez o encontro foi um pouco diferente, al\u00e9m de maior concentra\u00e7\u00e3o dos integrantes e ter sido bem divertido, tivemos algo inovador:\u00a0 por indica\u00e7\u00e3o do <a href=\"http:\/\/cncodingdojo.wordpress.com\/author\/marcomoura\/\">Marco Moura<\/a>, demos in\u00edcio ao\u00a0 <strong>Lightning Talk<\/strong> ( &#8220;palestra rel\u00e2mpago&#8221;, uma apresenta\u00e7\u00e3o bem curtinha de 5 minutos sobre a hist\u00f3ria da linguagem python). Foi escolhido um kata bem simples, o que facilitou o desenvolvimento.<\/p>\n<div>\n<table border=\"0\" width=\"100%\">\n<tbody>\n<tr>\n<td>\n<h3 style=\"text-align:center\">Problema: Adding Reversed Numbers<strong><span style=\"font-size: large; color: #c0ffff;\"><a name=\"SECTION0001000000000000000000\"><\/a><br \/>\n<\/span><\/strong><\/h3>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The Antique Comedians of Malidinesia prefer comedies to tragedies. Unfortunately, most of the ancient plays are tragedies. Therefore the dramatic advisor of ACM has decided to transfigure some tragedies into comedies. Obviously, this work is very hard because the basic sense of the play must be kept intact, although all the things change to their opposites. For example the numbers: if any number appears in the tragedy, it must be converted to its reversed form before being accepted into the comedy play.<\/p>\n<p>Reversed number is a number written in arabic numerals but the order of digits is reversed. The first digit becomes last and vice versa. For example, if the main hero had 1245 strawberries in the tragedy, he has 5421 of them now. Note that all the leading zeros are omitted. That means if the number ends with a zero, the zero is lost by reversing (e.g. 1200 gives 21). Also note that the reversed number never has any trailing zeros.<\/p>\n<p>ACM needs to calculate with reversed numbers. Your task is to add two reversed numbers and output their reversed sum. Of course, the result is not unique because any particular number  is a reversed form of several numbers (e.g. 21 could be 12, 120 or 1200 before reversing). Thus we must assume that no zeros were lost by reversing (e.g. assume that the original number was 12).<\/p>\n<h3><span style=\"color: #000000;\"><a name=\"SECTION0001001000000000000000\"> Input<\/a> <\/span><\/h3>\n<p>The input consists of <em>N<\/em> cases. The first line of the input contains only positive integer <em>N<\/em>. Then follow the cases. Each case consists of exactly one line with two positive integers separated by space. These are the reversed numbers you are to add. Numbers will be at most 200 characters long.<\/p>\n<h3><span style=\"color: #000000;\"><a name=\"SECTION0001002000000000000000\"> Output<\/a> <\/span><\/h3>\n<p>For each case, print exactly one line containing only one integer &#8211; the reversed sum of two reversed numbers.  Omit any leading zeros in the output.<\/p>\n<h3><span style=\"color: #000000;\"><a name=\"SECTION0001003000000000000000\"> Sample Input<\/a> <\/span><\/h3>\n<pre>3\r\n24 1\r\n4358 754\r\n305 794<\/pre>\n<h3><span style=\"color: #000000;\"><a name=\"SECTION0001004000000000000000\"> Sample Output<\/a> <\/span><\/h3>\n<pre>34\r\n1998\r\n1<\/pre>\n<\/div>\n<p><strong>Retrospectiva:<\/strong><\/p>\n<p><strong>Bom:<\/strong><\/p>\n<ul>\n<li>Kata legal<\/li>\n<li>Aprendemos mais sobre Python<\/li>\n<li>Lightning Talk foi legal<\/li>\n<li>Finalizamos o kata<\/li>\n<li>Foi divertido<\/li>\n<li>Celular n\u00e3o tocou<\/li>\n<li>Demonstrar no quadro a solu\u00e7\u00e3o<\/li>\n<\/ul>\n<p><strong>Ruim:<\/strong><\/p>\n<ul>\n<li>Preparar o ambiente<\/li>\n<li>Conhecer fun\u00e7\u00f5es Built-in<\/li>\n<li>Falta de um especialista Python<\/li>\n<li>Falta do curador<\/li>\n<li>Pulando Baby Steps<\/li>\n<li>Renomeando fun\u00e7\u00f5es Built-in<\/li>\n<li>Faltou refactoring<\/li>\n<\/ul>\n<p><strong>Para pr\u00f3ximos:<\/strong><\/p>\n<ul>\n<li>Lightning talk<\/li>\n<\/ul>\n<ul>\n<li>Estudar mais PYTHON<\/li>\n<\/ul>\n<p><strong>Dados do encontro:<\/strong><\/p>\n<p>Organizadores:\u00a0 <a title=\"Marco Moura\" href=\"http:\/\/twitter.com\/marcomoura\" target=\"_blank\">Marco Moura<\/a> e<a title=\"Patr\ufffdcia Carvalho\" href=\"http:\/\/twitter.com\/patfcarv\" target=\"_blank\"> Patr\u00edcia Carvalho<\/a><\/p>\n<p>Participantes:<a title=\"Carlos Eduardo\" href=\"http:\/\/twitter.com\/carlos_tumulto\" target=\"_blank\"> Carlos Eduardo<\/a>,\u00a0<a title=\"Marco Moura\" href=\"http:\/\/twitter.com\/marcomoura\" target=\"_blank\">Marco Moura<\/a>,\u00a0<a title=\"Nat\u00e1lia Marcondes\" href=\"http:\/\/twitter.com\/nati57\" target=\"_blank\">Nat\u00e1lia Marcondes<\/a>,\u00a0<a title=\"Patr\ufffdcia Carvalho\" href=\"http:\/\/twitter.com\/patfcarv\" target=\"_blank\">Patricia Carvalho<\/a>,\u00a0<a title=\"Rafael Salom\u00e3o\" href=\"http:\/\/twitter.com\/razzi\" target=\"_blank\">Rafael Salom\u00e3o<\/a>,\u00a0<a title=\"Luciana Mendes\" href=\"http:\/\/twitter.com\/lucihana\" target=\"_blank\">Luciana Mendes<\/a><\/p>\n<p>Kata: Adding Reversed Numbers (<strong><strong><span style=\"font-size: large; color: #c0ffff;\"><a name=\"SECTION0001000000000000000000\"><\/a><\/span><\/strong><\/strong><a title=\"http:\/\/uva.onlinejudge.org\/external\/7\/713.html\" href=\"http:\/\/uva.onlinejudge.org\/external\/7\/713.html\" target=\"_blank\">http:\/\/uva.onlinejudge.org\/external\/7\/713.html)<\/a><\/p>\n<p>C\u00f3digo fonte : <a title=\"http:\/\/gist.github.com\/624072\" href=\"http:\/\/gist.github.com\/624072\" target=\"_blank\">http:\/\/gist.github.com\/624072<\/a><\/p>\n<p>Fotos:<\/p>\n\n<div>\n<p><strong> <\/strong><\/p>\n<p><strong> <\/strong><\/p>\n<p><strong><img decoding=\"async\" src=\"http:\/\/cncodingdojo.wordpress.com\/wp-includes\/js\/tinymce\/plugins\/wpgallery\/img\/t.gif\" alt=\"\" \/><\/strong><br \/>\n<strong> <\/strong><\/p>\n<p><strong> <\/strong><\/p>\n<p><strong> <\/strong><\/p>\n<p><strong> <\/strong><\/p>\n<p><strong> <\/strong><\/p>\n<p><strong> <\/strong><\/p>\n<p><strong> <\/strong><\/p>\n<p><strong> <\/strong><\/p>\n<p><strong> <\/strong><\/p>\n<p><strong> <\/strong><strong> <\/strong><\/p>\n<p><strong> <\/strong><\/p>\n<p><strong> <\/strong><\/p>\n<p><strong> <\/strong><\/p>\n<p><strong> <\/strong><\/p>\n<p><strong> <\/strong><\/p>\n<p><strong> <\/strong><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Mais um Dojo finalizado. Dessa vez o encontro foi um pouco diferente, al\u00e9m de maior concentra\u00e7\u00e3o dos integrantes e ter sido bem divertido, tivemos algo inovador:\u00a0 por indica\u00e7\u00e3o do Marco Moura, demos in\u00edcio ao\u00a0 Lightning Talk ( &#8220;palestra rel\u00e2mpago&#8221;, uma&#8230;<\/p>\n","protected":false},"author":4437,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[36209,36211],"tags":[103619,103621],"_links":{"self":[{"href":"https:\/\/blog.cancaonova.com\/desenvolvimentoti\/wp-json\/wp\/v2\/posts\/621"}],"collection":[{"href":"https:\/\/blog.cancaonova.com\/desenvolvimentoti\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.cancaonova.com\/desenvolvimentoti\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.cancaonova.com\/desenvolvimentoti\/wp-json\/wp\/v2\/users\/4437"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.cancaonova.com\/desenvolvimentoti\/wp-json\/wp\/v2\/comments?post=621"}],"version-history":[{"count":5,"href":"https:\/\/blog.cancaonova.com\/desenvolvimentoti\/wp-json\/wp\/v2\/posts\/621\/revisions"}],"predecessor-version":[{"id":945,"href":"https:\/\/blog.cancaonova.com\/desenvolvimentoti\/wp-json\/wp\/v2\/posts\/621\/revisions\/945"}],"wp:attachment":[{"href":"https:\/\/blog.cancaonova.com\/desenvolvimentoti\/wp-json\/wp\/v2\/media?parent=621"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.cancaonova.com\/desenvolvimentoti\/wp-json\/wp\/v2\/categories?post=621"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.cancaonova.com\/desenvolvimentoti\/wp-json\/wp\/v2\/tags?post=621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}