1234567891011121314151617181920212223242526272829
#include<stdio.h> #include<math.h> #include<time.h> #include<stdlib.h> double randf(); int main() { double s; s=randf(); printf("%lf", s); return 0; } double randf() { double a = 1; double b = 0; double x[8]; for (int i = 0; i <= 8; ++i) { srand((unsigned)time(NULL)); x[i] = rand()*(a - b) / (double)RAND_MAX + b; } return x[i]; }