This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <set> | |
#include <algorithm> | |
using namespace std; | |
vector<int> loteria(int max, int quant) | |
{ | |
srand(unsigned(time(NULL))); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var s = new Array(); | |
s[0] = "Um texto qualquer"; | |
s[1] = "Aqui outro texto"; | |
s[2] = "E assim por diante"; | |
function texto(n) | |
{ | |
document.write(s[n]); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Primeiro criamos um vetor, chamado "frase", mas não incluímos nada nele. | |
var frase = new Array(); | |
//Agora vamos adicionando quantas frases quisermos no vetor, bastar ir acrescentando o índice de frase[i]. | |
frase[0] = "Frase um vem aqui."; | |
frase[1] = "Frase dois então."; | |
frase[2] = "Frase três."; | |
frase[3] = "Quarta frase aqui."; | |
frase[4] = "E assim por diante."; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function verifica(form) | |
{ | |
var num = parseInt(form.numero.value); | |
if (isNaN(num)) | |
form.resultado.value = (form.numero.value + " não é um número! Tente outra vez!"); | |
else | |
{ | |
if (num < 0) | |
num = num * (-1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createCookie(name,value,days) { | |
if (days) { | |
var date = new Date(); | |
date.setTime(date.getTime()+(days*24*60*60*1000)); | |
var expires = "; expires="+date.toGMTString(); | |
} | |
else var expires = ""; | |
document.cookie = name+"="+value+expires+"; path=/"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var speed = 1; | |
var currentpos = 0, alt = 1, curpos1 = 0, curpos2 = -1; | |
function initialize() | |
{ | |
setInterval("scrollwindow()", 80); | |
} | |
function scrollwindow() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function emailValido(email) | |
{ | |
var arroba = "@"; | |
var ponto = "."; | |
var larroba = email.indexOf(arroba); | |
if (email.indexOf(arroba) == -1) | |
{ | |
alert("Favor digitar um e-mail válido."); | |
return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<span id='proximoevento'></span> | |
<script> | |
var minutos = 187; | |
var timer; | |
window.onload = function contar() | |
{ | |
var horas = Math.floor(minutos / 60); | |
var minRestantes = minutos - (horas * 60); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var quantidade = prompt("Quantos números você quer digitar para saber qual é o maior?"); | |
if (isNaN(quantidade)) | |
alert("Você precisa informar um número inteiro!"); | |
else | |
verificaMaior(parseInt(quantidade)); | |
function verificaMaior(n) | |
{ | |
var entrada = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<iframe id='pagina' width='170' src='http://www.google.com.br/'></iframe> | |
<script type='text/javascript'> | |
function Reload() | |
{ | |
var f = document.getElementById('pagina'); | |
f.src = f.src; | |
setTimeout('Reload()',120000); //atualizado a cada 120 segundos | |
} |