#include #include #include #include double range_rand(double from, double to) { return (double)rand() / RAND_MAX * (to - from) + from; } int main(int argc, const char* argv[]) { if (argc < 4) { printf("usage: %s min max count\n", argv[0]); return -1; } double from = atof(argv[1]); double to = atof(argv[2]); int count = atoi(argv[3]); srand(time(0)); while (count--) { printf("%lf %lf\n", range_rand(from, to), range_rand(from, to)); } return 1; }