C++ 如何使用时间函数--记忆游戏(二)

2014-11-24 09:08:23 · 作者: · 浏览: 2
t "Correct!" : "Wrong!");
}

/* Calculate total time to play the game in seconds)*/
time_taken = (clock() - time_taken) / CLOCKS_PER_SEC;

/* Output the game score */
printf("\n\n Your score is %d", --counter * 100 / time_taken);

fflush(stdin);

/* Check if new game required*/
printf("\nDo you want to play again (y/n) ");
scanf("%c", &another_game);

}while(toupper(another_game) == 'Y');
return 0;
}