{"id":1047,"date":"2025-10-28T18:11:44","date_gmt":"2025-10-28T18:11:44","guid":{"rendered":"https:\/\/javigomez.org\/?p=1047"},"modified":"2025-12-05T16:53:14","modified_gmt":"2025-12-05T16:53:14","slug":"ar04-04-altura-de-arboles","status":"publish","type":"post","link":"https:\/\/javigomez.org\/index.php\/2025\/10\/28\/ar04-04-altura-de-arboles\/","title":{"rendered":"AR04.04 Altura de \u00e1rboles"},"content":{"rendered":"\n<pre class=\"wp-block-preformatted\">Solicitamos la altura de \u00e1rboles hasta -1<br>Los \u00e1rboles est\u00e1n n\u00famerados desde el 1,2,3,4..<br>Decir que \u00e1rbol es el m\u00e1s alto y cuanto mide<br>Ejemplo: <br>Altura del 1: 6<br>Altura del 2: 4<br>Altura del 3: 7<br>Altura del 4: -1<br>EL \u00e1rbol mas alto es el 3 con 7 metros<\/pre>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"AR04.04 Altura de \u00e1rboles\" width=\"1200\" height=\"900\" src=\"https:\/\/www.youtube.com\/embed\/rLtFejwsoec?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>import java.util.Scanner;\n\npublic class AR0404 {\n    public static void main(String&#91;] args) {\n        \/\/Solicitamos la altura de \u00e1rboles hasta -1\n        \/\/Los \u00e1rboles est\u00e1n n\u00famerados desde el 1,2,3,4..\n        \/\/Decir que \u00e1rbol es el m\u00e1s alto y cuanto mide\n        \/\/Altura del 1: 6\n        \/\/Altura del 2: 4\n        \/\/Altura del 3: 7\n        \/\/Altura del 4: -1\n        \/\/EL \u00e1rbol mas alto es el 3 con 7 metros\n\n        Scanner sc = new Scanner(System.in);\n        int ind=1,a_max=0, i_max=0;\n\n        System.out.println(\"Altura del \u00e1rbol \" + ind + \":\");\n        int alt=sc.nextInt();\n\n        while(alt!=-1){\n            if (alt > a_max){\n                a_max = alt;\n                i_max = ind;\n            }\n            ind++;\n            System.out.println(\"Altura del \u00e1rbol \" + ind + \":\");\n            alt=sc.nextInt();\n        }\n\n        System.out.println(\" El \u00e1rbol m\u00e1s alto es: \" + i_max + \" con un altura de \" + a_max + \" metros\");\n\n    }\n}\n<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Solicitamos la altura de \u00e1rboles hasta -1Los \u00e1rboles est\u00e1n n\u00famerados desde el 1,2,3,4..Decir que \u00e1rbol es el m\u00e1s alto y cuanto mideEjemplo: Altura del 1: &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[203],"class_list":["post-1047","post","type-post","status-publish","format-standard","hentry","category-java","tag-java"],"_links":{"self":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/1047","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/comments?post=1047"}],"version-history":[{"count":1,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/1047\/revisions"}],"predecessor-version":[{"id":1048,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/1047\/revisions\/1048"}],"wp:attachment":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/media?parent=1047"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/categories?post=1047"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/tags?post=1047"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}