Article View: es.comp.os.linux.programacion
Article #8135Re: Numero aleatorio limitado...
From: Fernando Arbeiza
Date: Mon, 16 Dec 2002 17:54
Date: Mon, 16 Dec 2002 17:54
14 lines
1325 bytes
1325 bytes
On Mon, 16 Dec 2002 18:30:01 +0100, Layn <Tole@oscuridad.com> wrote:
> f=1+(int) (65.0*rand()/(RAND_MAX+90.0));
#include <math.h>
#include <time.h>
srand((unsigned int)time(NULL));
f = (int)round(((rand() / (double)RAND_MAX) * ('Z' - 'A')) + 'A');
--
Fernando Arbeiza
arbeizaf [arroba(at)] ono [punto(dot)] com
LFS en castellano: <URL:http://www.escomposlinux.org/lfs-es>
Technical Details
Message-ID:
<slrnavs4qu.1a5.direccion_en_la_firma.address_in_signature@jupiter.olimpo>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!opentransit.net!fu-berlin.de!uni-berlin.de!62.42.160.52!not-for-mailReferences:
<atl2ii$fk9$1@nsnmpen2-gest.nuria.telefonica-data.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f86c8,f8b4a87364bc9d30 X-Google-Attributes: gidf86c8,public X-Google-ArrivalTime: 2002-12-16 10:52:38 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!opentransit.net!fu-berlin.de!uni-berlin.de!62.42.160.52!not-for-mail From: Fernando Arbeiza <direccion_en_la_firma.address_in_signature@homelinux.org> Newsgroups: es.comp.os.linux.programacion Subject: Re: Numero aleatorio limitado... Date: Mon, 16 Dec 2002 18:54:38 +0100 Lines: 14 Message-ID: <slrnavs4qu.1a5.direccion_en_la_firma.address_in_signature@jupiter.olimpo> References: <atl2ii$fk9$1@nsnmpen2-gest.nuria.telefonica-data.net> NNTP-Posting-Host: 62.42.160.52 X-Trace: fu-berlin.de 1040064752 251996 62.42.160.52 (16 [148301]) X-Orig-Path: jupiter.olimpo!news User-Agent: slrn/0.9.7.4 (Linux)