Ver Mensaje Individual
  #5 (permalink)  
Antiguo 26/09/2008, 12:37
Avatar de Ronruby
Ronruby
 
Fecha de Ingreso: julio-2008
Ubicación: 18°30'N, 69°59'W
Mensajes: 4.879
Antigüedad: 15 años, 9 meses
Puntos: 416
Respuesta: Contar | Algoritmo

En PHP algo como:

Código PHP:
<?php

$N 
= (int) 8;
//$N = $N - 1; Podemos hacer esto o usar (N-1(N))/2 directamente.
//Lo usare directamente:

$suma = (($N-1)($N))/2;

echo 
$suma;

?>