{"id":7277,"date":"2022-08-30T06:00:40","date_gmt":"2022-08-30T04:00:40","guid":{"rendered":"http:\/\/www.glc.us.es\/~jalonso\/exercitium\/?p=7277"},"modified":"2022-12-14T16:41:49","modified_gmt":"2022-12-14T14:41:49","slug":"tres-diferentes","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/exercitium\/tres-diferentes\/","title":{"rendered":"Tres diferentes"},"content":{"rendered":"<p>Definir la funci\u00f3n<\/p>\n<pre lang=\"text\">\n   tresDiferentes :: Int -> Int -> Int -> Bool\n<\/pre>\n<p>tal que <code>(tresDiferentes x y z)<\/code> se verifica si los elementos <code>x<\/code>, <code>y<\/code> y <code>z<\/code> son distintos. Por ejemplo,<\/p>\n<pre lang=\"text\">\n   tresDiferentes 3 5 2  ==  True\n   tresDiferentes 3 5 3  ==  False\n<\/pre>\n<p><b>Soluciones<\/b><\/p>\n<p>A continuaci\u00f3n se muestran las <a href=\"#haskell\">soluciones en Haskell<\/a> y las <a href=\"#python\">soluciones en Python<\/a>.<\/p>\n<p><a name=\"haskell\"><\/a><br \/>\n<b>Soluciones en Haskell<\/b><\/p>\n<pre lang=\"haskell\">\ntresDiferentes :: Int -> Int -> Int -> Bool\ntresDiferentes x y z = x \/= y && x \/= z && y \/= z\n<\/pre>\n<p>El c\u00f3digo se encuentra en <a href=\"https:\/\/github.com\/jaalonso\/Exercitium\/blob\/main\/src\/Tres_diferentes.hs\">GitHub<\/a>.<\/p>\n<p><a name=\"python\"><\/a><br \/>\n<b>Soluciones en Python<\/b><\/p>\n<pre lang=\"python\">\ndef tresDiferentes(x: int, y: int, z: int) -> bool:\n    return x != y and x != z and y != z\n<\/pre>\n<p>El c\u00f3digo se encuentra en <a href=\"https:\/\/github.com\/jaalonso\/Exercitium-Python\/blob\/main\/src\/tres_diferentes.py\">GitHub<\/a>.<\/p>\n<p><b>Comentarios<\/b><\/p>\n<ul>\n<li>Para decidir si <code>x<\/code> e <code>y<\/code> son distintos, se escribe\n<ul>\n<li><code>x \/= y<\/code> en Haskell y<\/li>\n<li><code>x != y<\/code> en Python.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Definir la funci\u00f3n tresDiferentes :: Int -> Int -> Int -> Bool tal que (tresDiferentes x y z) se verifica si los elementos x, y y z son distintos. Por ejemplo, tresDiferentes 3 5 2 == True tresDiferentes 3 5 3 == False Soluciones A continuaci\u00f3n se muestran las soluciones en Haskell y las soluciones&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"footnotes":"","_jetpack_memberships_contains_paid_content":false},"categories":[581],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/exercitium\/wp-json\/wp\/v2\/posts\/7277"}],"collection":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/exercitium\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/exercitium\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/exercitium\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/exercitium\/wp-json\/wp\/v2\/comments?post=7277"}],"version-history":[{"count":3,"href":"https:\/\/www.glc.us.es\/~jalonso\/exercitium\/wp-json\/wp\/v2\/posts\/7277\/revisions"}],"predecessor-version":[{"id":7703,"href":"https:\/\/www.glc.us.es\/~jalonso\/exercitium\/wp-json\/wp\/v2\/posts\/7277\/revisions\/7703"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/exercitium\/wp-json\/wp\/v2\/media?parent=7277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/exercitium\/wp-json\/wp\/v2\/categories?post=7277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/exercitium\/wp-json\/wp\/v2\/tags?post=7277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}