Taz bisounours-codeur | [benoit@athlon tmp]$ cat antp_a_tort.c |
Code :
- #include <stdio.h>
- int main()
- {
- char nom[100], prenom[100], sexe;
- int age, departement, remuneration;
- while(fscanf(stdin,"%[^;];%[^;];%c;%d;%d;%d;\n", nom, prenom, &sexe, &age, &d
- epartement, &remuneration) == 6)
- {
- fprintf(stdout,"-> %s - %s - %c - %d - %d - %d\n", nom, prenom, sexe, age, d
- epartement, remuneration);
- }
- return 0;
- }
|
[benoit@athlon tmp]$ gcc_ansi antp_a_tort.c && echo -e "xxxx;benoit;m;20;64;0;\nyyyy;programmeuse python;f;20;60;696969\n" | ./a.out
-> xxxx - benoit - m - 20 - 64 - 0
-> yyyy - programmeuse python - f - 20 - 60 - 696969 |
Message édité par Taz le 13-10-2003 à 01:02:22
|