Article View: fr.comp.os.msdos
Article #81Re: un generateur de nombre aleatoire sous DOS
From: AG
Date: Thu, 21 Jul 2005 15:51
Date: Thu, 21 Jul 2005 15:51
33 lines
2138 bytes
2138 bytes
S�bastien WILLEMIJNS wrote:
> On Thu, 21 Jul 2005 10:49:59 +0200, AG <ag@tb.fr> wrote:
>
>
>>#include <stdio.h>
>>#include <stdlib.h>
>>#include <time.h>
>>
>>
>>int main(int argc, char * argv[])
>>{
>> int a = atoi(argv[1]);
>> int b = atoi(argv[2]);
>> int c = a>b ? a:b;
>> int d = a<b ? a:b;
>>
>> if(argc!=3) printf("usage : hazard.exe n1 n2");
>> srand(time(NULL));
>> printf("%d\n",(int)(((double)rand())/RAND_MAX*(c-d)+0.5)+d);
>> return 0;
>>}
>
>
> merci de ton petit programme mais il crash avec le gcc de cygwin
? pas chez moi en tout cas. Si tu veux le faire marcher sous dos, il te
faut un compilo msdos. Tu ne pourras pas le faire marcher sous dos si tu
compiles avec cygwin. Et encore, quand tu parles de msdos, tu veux dire
une fen�tre dos, ou bien le vrai systeme d'exploitation ? Parce que si
en fait c'est juste une "fenetre dos", et que t'es sous Windows, faut un
compilo windows.
AG, dubitatif.
Technical Details
Message-ID:
<42dfc1f0$0$10758$636a15ce@news.free.fr>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!infeed-2.proxad.net!news6-e.free.fr!not-for-mailReferences:
<dbmgem$2378$1@talisker.lacave.net> <42df5f16$0$22531$636a15ce@news.free.fr> <dbod0h$1hnu$1@talisker.lacave.net>Show Full Headers
Complete Article Headers
X-Google-Thread: 10f688,1b9cd5f314610f29 X-Google-Thread: f9822,1b9cd5f314610f29 X-Google-Attributes: gid10f688,gidf9822,public X-Google-Language: FRENCH,ASCII Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!infeed-2.proxad.net!news6-e.free.fr!not-for-mail Date: Thu, 21 Jul 2005 17:51:45 +0200 From: AG <ag@tb.fr> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: fr.comp.os.msdos,fr.comp.lang.c Subject: Re: un generateur de nombre aleatoire sous DOS References: <dbmgem$2378$1@talisker.lacave.net> <42df5f16$0$22531$636a15ce@news.free.fr> <dbod0h$1hnu$1@talisker.lacave.net> In-Reply-To: <dbod0h$1hnu$1@talisker.lacave.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Lines: 33 Message-ID: <42dfc1f0$0$10758$636a15ce@news.free.fr> Organization: Guest of ProXad - France NNTP-Posting-Date: 21 Jul 2005 17:40:32 MEST NNTP-Posting-Host: 83.195.118.95 X-Trace: 1121960432 news6-e.free.fr 10758 83.195.118.95:64444 X-Complaints-To: abuse@proxad.net