SCR
This commit is contained in:
19
TP4/Ex1:/rebours.c
Normal file
19
TP4/Ex1:/rebours.c
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
assert(argc == 2);
|
||||
|
||||
int value = strtol(argv[1], NULL, 0);
|
||||
pid_t p = getpid();
|
||||
printf("%d: debut\n",p);
|
||||
for(int i = value; i>0; i--){
|
||||
printf("%d: %d\n",p,i);
|
||||
sleep(1);
|
||||
}
|
||||
printf("%d: fin\n",p);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
Reference in New Issue
Block a user