#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int randomInteger(int low, int high)
{
int k;
double d;
d
= (double)rand() / ((double)RAND_MAX
+ 1); k = (int) (d * (high - low + 1));
return low + k;
}
void randomize()
{
}
int main() {
randomize();
int i;
for (i = 0; i < 100; i++)
printf("%d ", randomInteger
(0, 9)); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHRpbWUuaD4KCmludCByYW5kb21JbnRlZ2VyKGludCBsb3csIGludCBoaWdoKQp7CglpbnQgazsKCWRvdWJsZSBkOwoJZCA9IChkb3VibGUpcmFuZCgpIC8gKChkb3VibGUpUkFORF9NQVggKyAxKTsKCWsgPSAoaW50KSAoZCAqIChoaWdoIC0gbG93ICsgMSkpOwoJcmV0dXJuIGxvdyArIGs7Cn0KCnZvaWQgcmFuZG9taXplKCkKewoJc3JhbmQodGltZShOVUxMKSk7Cn0KCmludCBtYWluKCkgewoKCXJhbmRvbWl6ZSgpOwoJaW50IGk7Cglmb3IgKGkgPSAwOyBpIDwgMTAwOyBpKyspCgkJcHJpbnRmKCIlZCAiLCByYW5kb21JbnRlZ2VyKDAsIDkpKTsKCXJldHVybiAwOwp9