#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#define LONGITUD 50
#define TEMPS 60
#define TOP 5
char *paraules[]={"llibre","mantega","carrer","pernil","pilota"};
char top_noms[TOP][LONGITUD];
int top_punts[TOP];
int main()
{
int i,n,num;
int encerts;
char resposta[LONGITUD];
time_t t;
srand(time(NULL));
for(i=0;i<TOP;i++)
top_punts[i]=-1;
n=sizeof(paraules)/sizeof(char*);
do
{
printf("nnEntra les paraules que van sortintn");
t=time(NULL);
while(difftime(time(NULL),t)<TEMPS)
{
num=rand()%num;
puts(paraules[num]);
gets(resposta);
if(strcmp(resposta,paraules[num])==0)
{
if(difftime(time(NULL),t)<TEMPS)
{
encerts++;
puts("OKn");
}
else
puts("Fora de Tempsn");
}
else
puts("Errorn");
}
printf("Continuar(si/no)?n");
gets(resposta);
}while(strcmp(resposta,"si")==0);
getchar();
getchar();
}