{"id":1051,"date":"2025-11-04T21:29:03","date_gmt":"2025-11-04T21:29:03","guid":{"rendered":"https:\/\/javigomez.org\/?p=1051"},"modified":"2025-11-04T22:18:28","modified_gmt":"2025-11-04T22:18:28","slug":"ar0308-resolver-ecuaciones-de-segundo-grado","status":"publish","type":"post","link":"https:\/\/javigomez.org\/index.php\/2025\/11\/04\/ar0308-resolver-ecuaciones-de-segundo-grado\/","title":{"rendered":"AR0308. Resolver ecuaciones de segundo grado"},"content":{"rendered":"\n<pre class=\"wp-block-preformatted\">Resolver una ecuaci\u00f3n de segundo grado<br>ax^2+bx+c=0<br>validar que tenga soluci\u00f3n<br>(-b +- raiz(b^2-4ac)) \/ (2*a)<\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>import java.util.Scanner;\n\npublic class ER0308 {\n    public static void main(String&#91;] args) {\n        \/\/Resolver una ecuaci\u00f3n de segundo grado\n        \/\/ax^2+bx+c=0\n        \/\/validar que tenga soluci\u00f3n\n        \/\/(-b +- raiz(b^2-4ac)) \/ (2*a)\n        Scanner sc = new Scanner(System.in);\n        System.out.println(\"a\");\n        int a = sc.nextInt();\n        System.out.println(\"b\");\n        int b = sc.nextInt();\n        System.out.println(\"c\");\n        int c = sc.nextInt();\n        \/\/b^2-4ac\n        int d=b*b - 4*a*c;\n        if (d&lt;0)\n            System.out.println(\"no tiene soluci\u00f3n\");\n        else if (a==0)\n            System.out.println(\"No es de segundo grado\");\n        else{\n            double s1=(-b + Math.sqrt(d))\/ (2*a);\n            double s2=(-b - Math.sqrt(d))\/ (2*a);\n            System.out.println(\"Soluci\u00f3n 1: \" + s1+\" Soluci\u00f3n 2: \"+s2);\n        }\n\n\n\n\n\n\n    }\n}\n<\/code><\/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=\"AR308. Resoluci\u00f3n de ecuaciones de segundo grado\" width=\"1200\" height=\"900\" src=\"https:\/\/www.youtube.com\/embed\/o8GdeNVJpHw?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","protected":false},"excerpt":{"rendered":"<p>Resolver una ecuaci\u00f3n de segundo gradoax^2+bx+c=0validar que tenga soluci\u00f3n(-b +- raiz(b^2-4ac)) \/ (2*a)<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[203],"class_list":["post-1051","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\/1051","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=1051"}],"version-history":[{"count":2,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/1051\/revisions"}],"predecessor-version":[{"id":1053,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/1051\/revisions\/1053"}],"wp:attachment":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/media?parent=1051"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/categories?post=1051"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/tags?post=1051"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}