Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<title>Bio</title>
<STYLE>
H1 { font-size: 400%; margin-bottom: 0ex; margin-top: 1.5ex; padding-left: 0.21em;
color: #440099; text-align: center; }
/*border-bottom: thick solid #6600cc; }*/
TH { text-align: left; vertical-align: top; padding-right: 1em; }
for(i = 1; i <= 100; i++){
if((i%3 == 0) && (i%5 != 0)){
console.log("Benito");
}
else if((i%5 == 0) && (i%3 != 0)){
console.log("Campeon");
}
else if((i%5 == 0) && (i%3 == 0)){
console.log("Benito Campeon");
}
<script>
function factorialIter(n){
var a = 1;
var x = parseInt(n);
for(m = x; m > 0; m--)
{
a = a * m;
}
@byron-perez
byron-perez / gist:345fd78c4881e7160950dcc2f85db97c
Created June 23, 2017 05:03
version recursiva de algoritmos
<script>
function factorialRecursivo(n){
var x = parseInt(n);
if(x == 0) return 1;
return x * factorialRecursivo(x - 1);
}
@byron-perez
byron-perez / ejer.html
Created July 6, 2017 04:07
ejercicios julio 05 2017
<!DOCTYPE html>
<html>
<head>
<title> ejercicio</title>
</head>
<body>
<span id="stars">
<img id="1" src="hola/chistosas.jpg" onclick="cambiar();">
<img src="hola/chistosas.jpg">
<img src="hola/chistosas.jpg">
@byron-perez
byron-perez / dom_ejerc.js
Created July 6, 2017 17:55
ejercicio06072017
nextNode = function(node) {
//...Code goes here to walk to the next node...
if(node.childNodes.length != 0)
{
return node.firstChild;
}
else if(node.childNodes.length == 0 && node.nextSibling != null)
{
return node.nextSibling;
#!/bin/python3
import sys
#functions
def BFS(G, s):
explored = []
queue = [s]
#!/bin/python3
import sys
#functions
def bsearch(x, L):
if x == L[len(L) // 2]:
return True
if (len(L) // 2) == 0:
return False
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <bits/stdc++.h>
using namespace std;
int numDigits(int number)
{
int digits = 0;
if (number < 0) digits = 1; // remove this line if '-' counts as a digit
while (number) {
number /= 10;