Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- int timer(long seconds);
- int main()
- {
- long seconds;
- printf("Entrez le nombre de secondes \205 patienter :\n");
- scanf("%d", &seconds);
- system("cls");
- if(timer(seconds)== 1){
- system("cls");
- printf("temps imparti fini, question suivante \n");
- }
- }
- int timer(long seconds){
- while (seconds > 0){
- printf("\rSecondes restantes : %03i", seconds);
- seconds--;
- _sleep(1000); //on attend 1 seconde mais on devra faire un multithread pour géré la réponse et le chrono séparéménetnt
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement