Test [code] Nemo

Liste des Groupes 
Sujet : Test [code] Nemo
De : jpierre.messager (at) *nospam* gmail.com (Python)
Groupes : fr.test nemo.test
Date : 14. Dec 2024, 10:14:23
Autres entêtes
Organisation : Nemoweb
Message-ID : <XD8Lwe4dK3KTPLEQWb87162DcHk@jntp>
User-Agent : Nemo/1.0
#include<stdlib.h>
#include<stdio.h>
#include<time.h>
#define N 100000000L
int main() {
    double x,y,d;
    long int incircle = 0;
    srand48(time(NULL));
    for (int i = 0; i < N; i++) {
        x = drand48();         y = drand48();         if (x*x + y*y < 1) {
            incircle++;
        }
    }
    // printf("%d\n", incircle);
    printf("%f\n", (double)incircle/N * 4 );
    exit(EXIT_SUCCESS);
}

Date Sujet#  Auteur
14 Dec 24 * Test [code] Nemo3Python
15 Dec 24 `* Re: Test [code] Nemo2Ray_Net
15 Dec 24  `- Re: Test [code] Nemo1Python

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal