blob: acaecad44dcd92841eb2c485d81194d32260cf9e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
int main(int argc, char **argv)
{
time_t ltime;
time(<ime);
printf("the time is %s", ctime(<ime));
unsigned int seed=time(NULL);
printf("seed = %u\n",seed);
srand(seed);
for(int i=0;i<10;i++)
{
int r=rand()%100;
printf("sin(%i) = %f \n",r,sin(r));
}
return 0;
}
|