Calculo de Fibonacci en C sharp
C sharp
(1)
Publicado el 1 de Mayo del 2021 por Joan (121 códigos)
3.223 visualizaciones desde el 1 de Mayo del 2021
Función recursiva para calcular la sucesión de números del fibonacci.
a1=[1, 2, 3];
a2=[9, 9, 9];
intercalarDosArrays(a1, a2); // [9, 1, 9, 2, 9, 3]
a1=[1, 2, 3, 4, 5];
a2=[9, 9, 9];
intercalarDosArrays(a1, a2); // [1, 9, 2, 9, 3, 9, 4, 5]
a1=["a", "i", "u"];
a2=["e", "o"];
intercalarDosArrays(a1, a2); // ['a', 'e', 'i', 'o', 'u']
let [l, s]=a1.length > a2.length ? [a1, a2] : [a2, a1];
Array.from({length: l.length*2}).map((_, i) => i%2==0 ? l[i/2] : s[Math.ceil(i/2)-1]).filter(el => el);
arr.reduce((acum, el, i) => acum[0] > el ? acum : [el, i], [0, 0])[1];
indiceDelMasGrande([85, 100, 90]); // 1
indiceDelMasGrande([8, 8, 8]); // 2
indiceDelMasGrande([850, 100, 90]); // 0
recorrerElDom(document.querySelector("ul")); // [div, body, html]
recorrerElDom(document.querySelector("ul"), "tagName"); // ["DIV", "BODY", "HTML"]
recorrerElDom(document.querySelector("ul"), "offsetWidth"); // [469, 469, 485]
recorrerElDom(document.getElementById("segundoLi"), "nextSibling"); // [text, text, null, null]
recorrerElDom(document.getElementById("segundoLi")); // [ul, div, body, html]
recorrerElDom(document.getElementById("segundoLi"), "tagName"); // ["UL", "DIV", "BODY", "HTML"]
recorrerElDom(document.querySelector("span"), "tagName"); // ["P", "DIV", "LI", "UL", "DIV", "BODY", "HTML"]
(función () {$ .ajax ({url: "<urlto> class_ezcaptcha.php? getHtml = 1", éxito: función (resultado) {
$ ("captcha"). html (resultado);
}});
}) ();
if ($ _ POST ['captcha']! = $ _ SESSION ['captcha_code']) {return "ERRORcaptcha | Captcha incorrecto";}