2023-04-03 07:53:00 +11:00
|
|
|
/*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
int essai_lecture_face(char *str)
|
|
|
|
{
|
|
|
|
char *buffer, *ptr;
|
|
|
|
int bar;
|
|
|
|
int A, B, C;
|
|
|
|
|
|
|
|
printf("-------- '%s'\n", str);
|
|
|
|
buffer = ptr = strdup(str);
|
|
|
|
for (bar = 0;;) {
|
|
|
|
ptr = strtok(ptr, " \t");
|
|
|
|
if (NULL != ptr) {
|
|
|
|
printf("\t%2d '%s'\n", bar, ptr);
|
|
|
|
ptr = NULL;
|
|
|
|
bar++;
|
|
|
|
}
|
|
|
|
else break;
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
* so, here, we know the number of thing to decipher
|
|
|
|
*/
|
|
|
|
|
|
|
|
free(buffer);
|
|
|
|
printf(" -> %d\n", bar);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
int foo, bar;
|
|
|
|
|
|
|
|
foo = essai_lecture_face("3 14 159");
|
|
|
|
foo = essai_lecture_face("2 4 6 8");
|
|
|
|
foo = essai_lecture_face("0/10 1/11 2/12");
|
2023-04-09 20:13:56 +11:00
|
|
|
foo = essai_lecture_face("3.14159");
|
|
|
|
foo = essai_lecture_face("We make porn");
|
2023-04-03 07:53:00 +11:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|