/* lottery.c */
/* This program runs a simple little "lottery" */
/* Your task is to win it with 100% probability */
#include <stddef.h>
#include <stdio.h> /* for printf() */
#include <stdlib.h> /* for rand() and srand() */
#include <sys/time.h> /* for gettimeofday() */
int your_fcn()
{
/* Provide three different versions of this, */
/* that each win the "lottery" in main(). */
return 0;
}

int main()
{
struct timeval tv; /* Seed the random number generator */
gettimeofday(&tv, NULL);
srand(tv.tv_usec);
const char *sad = ":(";
const char *happy = ":)";
int rv;
rv = your_fcn();
/* Lottery time */
if(rv != rand())
printf("You lose %s\n", sad);
else
printf("You win! %s\n", happy);
return EXIT_SUCCESS;
}
