-
Fototrend
Új hozzászólás Aktív témák
-
amargo
addikt
válasz
Steve-S #3114 üzenetére
// crt_rand.c
// This program seeds the random-number generator
// with the time, then displays 10 random integers.
//
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
int main( void )
{
int i;
// Seed the random-number generator with current time so that
// the numbers will be different every time we run.
//
srand( (unsigned)time( NULL ) );
// Display 10 numbers.
for( i = 0; i < 10;i++ )
printf( " %6d\n", rand() );
printf("\n");
// Usually, you will want to generate a number in a specific range,
// such as 0 to 100, like this:
{
int RANGE_MIN = 0;
int RANGE_MAX = 100;
for (i = 0; i < 10; i++ )
{
int rand100 = (((double) rand() /
(double) RAND_MAX) * RANGE_MAX + RANGE_MIN);
printf( " %6d\n", rand100);
}
}
}De van a Random.Next(10) de ez asszem .NET-es vagy a random(10) is jó lehet, kicsi help olvasgatás
Új hozzászólás Aktív témák
● olvasd el a téma összefoglalót!
- Nvidia Quadro M2000/ M4000/ P2000/ P2200/ P4000/ P5000/ RTX 4000/ RTX A2000 / RTX A4000
- Philips PowerPro Aqua Porszívó és felmosórendszer FC6404/01
- 3DKRAFT.HU - 3D NYOMTATÁS - AZONNALI ÁRAJÁNLAT - GYORS KIVITELEZÉS - 480+ POZITÍV ÉRTÉKELÉS
- AKCIÓ! Apple Macbook Pro 16" 2019 i9 9980HK 64GB DDR4 1TB SSD Radeon Pro 5500M garanciával
- ÁRGARANCIA! Épített KomPhone i5 10600KF 16/32/64GB RAM RX 7600 8GB GAMER PC termékbeszámítással
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest