1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
#ifdef __turboc__
#include <conio.h>
#else
#include <conio2.h>
#endif
#include <string.h>
#define NB_COL 80
void afficher_saisie (int col, int lin, char const *txt, int larg)
{
gotoxy (col, lin);
cprintf ("%s :", txt);
gotoxy (col + strlen (txt) + 3, lin);
{
int i;
{
for (i = 0; i < larg; i++)
{
cprintf ("%c", '.');
}
}
}
}
void afficher (int col, int lin, char const *txt)
{
gotoxy (col, lin);
cprintf ("%s", txt);
}
void afficher_centre (int lin, char const *txt)
{
int const len = strlen (txt);
int const col = (NB_COL - len) / 2;
afficher (col, lin, txt);
gotoxy (col, lin + 1);
{
int i;
for (i = 0; i < len; i++)
{
putch ('-');
}
}
}
int main (void)
{
clrscr ();
afficher_centre (2, "Fiche signaletique");
afficher_saisie (15, 5, "Nom", 20);
afficher_saisie (42, 5, "Prenom", 20);
afficher (5, 8, "Adresse :");
afficher_saisie (15, 8, "Rue", 30);
afficher_saisie (53, 8, "Numero", 6);
afficher_saisie (15, 10, "Localite", 25);
afficher_saisie (15, 12, "Code postal", 4);
afficher (5, 15, "GSM :");
afficher_saisie (15, 15, "Prefixe", 4);
afficher_saisie (15, 17, "Numero", 6);
afficher (5, 20, "Etes vous :");
afficher (25, 20, "1 : Demoiselle");
afficher (25, 21, "2 : Dame");
afficher (25, 22, "3 : Homme");
afficher_saisie (25, 23, "Faites votre choix", 1);
getch ();
return 0;
} |
Partager