Accueil > > > TRADUIRE UNE DATE EN TEXTE
TRADUIRE UNE DATE EN TEXTE
Information sur la source
Description
Ce code traduire toutes les dates valides entre 1995 et 2005 saisies jj mm aaaa et les restituent en texte.
Source
- program LIREDATE;
-
- uses
- Forms;
-
- VAR date : STRING[10];
- jour : STRING[2];
- mois : STRING[2];
- annee : STRING[4];
- transa, transm, transj : string;
- begin
- WRITELN('inscrivez la date a convertir sous forme jj mm aaaa');
- READLN (date);
- jour :=COPY(date,1,2);
- mois :=COPY(date,4,5);
- annee :=COPY(date,7,8);
- Begin{traduction de l'annee}
-
- IF annee = '1995' then
- transa := 'mille neuf cent quatre-vingt quinze'
- ELSE
- IF annee = '1996' then
- transa := 'mille neuf cent quatre-vingt seize'
- ELSE
- IF annee = '1997' then
- transa := 'mille neuf cent quatre-vingt dix-sept'
- ELSE
- IF annee = '1998' then
- transa := 'mille neuf cent quatre-vingt dix-huit'
- ELSE
- IF annee = '1999' then
- transa := 'mille neuf cent quatre-vingt dix-neuf'
- ELSE
- IF annee = '2000' then
- transa := 'deux mille'
- ELSE
- IF annee = '2001' then
- transa := 'deux mille un'
- ELSE
- IF annee = '2002' then
- transa := 'deux mille deux'
- ELSE
- IF annee = '2003' then
- transa := 'deux mille trois'
- ELSE
- IF annee = '2004' then
- transa := 'deux mille quatre'
- ELSE
- IF annee = '2005' then
- transa := 'deux mille cinq'
- ELSE writeln('l''annee est incorrecte');
- End;{fin de la traduction de l'annee}
-
- Begin{traduction du mois}
- IF mois = '01' then
- transm := 'janvier'
- ELSE
- IF mois = '02' then
- transm := 'fevrier'
- ELSE
- IF mois = '03' then
- transm := 'mars'
- ELSE
- IF mois = '04' then
- transm := 'avril'
- ELSE
- IF mois = '05' then
- transm := 'mai'
- ELSE
- IF mois = '06' then
- transm := 'juin'
- ELSE
- IF mois = '07' then
- transm := 'juillet'
- ELSE
- IF mois = '08' then
- transm := 'aout'
- ELSE
- IF mois = '09' then
- transm := 'septembre'
- ELSE
- IF mois = '10' then
- transm := 'octobre'
- ELSE
- IF mois = '11' then
- transm := 'novembre'
- ELSE
- IF mois = '12' then
- transm := 'decembre'
- ELSE writeln('le mois est incorrect');
- end;{fin de la traduction du mois}
-
- Begin
- IF jour = '01' then
- transj := 'premier'
- ELSE
- IF jour = '02' then
- transj := 'deux'
- ELSE
- IF jour = '03' then
- transj := 'trois'
- ELSE
- IF jour = '04' then
- transj := 'quatre'
- ELSE
- IF jour = '05' then
- transj := 'cinq'
- ELSE
- IF jour = '06' then
- transj := 'six'
- ELSE
- IF jour = '07' then
- transj := 'sept'
- ELSE
- IF jour = '08' then
- transj := 'huit'
- ELSE
- IF jour = '09' then
- transj := 'neuf'
- ELSE
- IF jour = '10' then
- transj := 'dix'
- ELSE
- IF jour = '11' then
- transj := 'onze'
- ELSE
- IF jour = '12' then
- transj := 'douze'
- ELSE
- IF jour = '13' then
- transj := 'treize'
- ELSE
- IF jour = '14' then
- transj := 'quatorze'
- ELSE
- IF jour = '15' then
- transj := 'quinze'
- ELSE
- IF jour = '16' then
- transj := 'seize'
- ELSE
- IF jour = '17' then
- transj := 'diz-sept'
- ELSE
- IF jour = '18' then
- transj := 'dix-huit'
- ELSE
- IF jour = '19' then
- transj := 'dix-neuf'
- ELSE
- IF jour = '20' then
- transj := 'vingt'
- ELSE
- IF jour = '21' then
- transj := 'vingt et un'
- ELSE
- IF jour = '22' then
- transj := 'vingt-deux'
- ELSE
- IF jour = '23' then
- transj := 'vingt-trois'
- ELSE
- IF jour = '24' then
- transj := 'vingt-quatre'
- ELSE
- IF jour = '25' then
- transj := 'vingt-cinq'
- ELSE
- IF jour = '26' then
- transj := 'vingt-six'
- ELSE
- IF jour = '27' then
- transj := 'vingt-sept'
- ELSE
- IF jour = '28' then
- transj := 'vingt-huit'
- ELSE{Prb annee bisextille}
- IF jour = '29' then
- IF mois = '02' then
- IF annee = '1996' then
- transj :='vingt-neuf'
- else if annee = '2000' then
- transj :='vingt-neuf'
- else if annee = '2004' then
- transj :='vingt-neuf'
- else writeln('le jour est incorrect')
- else transj :='vingt-neuf'
- ELSE
- IF jour = '30' then
- IF mois = '02' then
- writeln ('le jour est incorrect')
- Else transj := 'trente'
- ELSE{Prb mois a 31 jours}
- IF jour = '31' then
- IF mois = '02' then
- Writeln('le jour est incorrect')
- Else if mois = '04' then
- Writeln('le jour est incorrect')
- Else if mois = '06' then
- Writeln('le jour est incorrect')
- Else if mois = '09' then
- Writeln('le jour est incorrect')
- Else if mois = '11' then
- Writeln('le jour est incorrect')
- Else transj :='trente et un'
- ELSE writeln('le jour est incorrect');
- end;{fin de la traduction du mois}
- WRITELN (transj, ' ', transm, ' ', transa);
- Readln;
- end.
program LIREDATE;
uses
Forms;
VAR date : STRING[10];
jour : STRING[2];
mois : STRING[2];
annee : STRING[4];
transa, transm, transj : string;
begin
WRITELN('inscrivez la date a convertir sous forme jj mm aaaa');
READLN (date);
jour :=COPY(date,1,2);
mois :=COPY(date,4,5);
annee :=COPY(date,7,8);
Begin{traduction de l'annee}
IF annee = '1995' then
transa := 'mille neuf cent quatre-vingt quinze'
ELSE
IF annee = '1996' then
transa := 'mille neuf cent quatre-vingt seize'
ELSE
IF annee = '1997' then
transa := 'mille neuf cent quatre-vingt dix-sept'
ELSE
IF annee = '1998' then
transa := 'mille neuf cent quatre-vingt dix-huit'
ELSE
IF annee = '1999' then
transa := 'mille neuf cent quatre-vingt dix-neuf'
ELSE
IF annee = '2000' then
transa := 'deux mille'
ELSE
IF annee = '2001' then
transa := 'deux mille un'
ELSE
IF annee = '2002' then
transa := 'deux mille deux'
ELSE
IF annee = '2003' then
transa := 'deux mille trois'
ELSE
IF annee = '2004' then
transa := 'deux mille quatre'
ELSE
IF annee = '2005' then
transa := 'deux mille cinq'
ELSE writeln('l''annee est incorrecte');
End;{fin de la traduction de l'annee}
Begin{traduction du mois}
IF mois = '01' then
transm := 'janvier'
ELSE
IF mois = '02' then
transm := 'fevrier'
ELSE
IF mois = '03' then
transm := 'mars'
ELSE
IF mois = '04' then
transm := 'avril'
ELSE
IF mois = '05' then
transm := 'mai'
ELSE
IF mois = '06' then
transm := 'juin'
ELSE
IF mois = '07' then
transm := 'juillet'
ELSE
IF mois = '08' then
transm := 'aout'
ELSE
IF mois = '09' then
transm := 'septembre'
ELSE
IF mois = '10' then
transm := 'octobre'
ELSE
IF mois = '11' then
transm := 'novembre'
ELSE
IF mois = '12' then
transm := 'decembre'
ELSE writeln('le mois est incorrect');
end;{fin de la traduction du mois}
Begin
IF jour = '01' then
transj := 'premier'
ELSE
IF jour = '02' then
transj := 'deux'
ELSE
IF jour = '03' then
transj := 'trois'
ELSE
IF jour = '04' then
transj := 'quatre'
ELSE
IF jour = '05' then
transj := 'cinq'
ELSE
IF jour = '06' then
transj := 'six'
ELSE
IF jour = '07' then
transj := 'sept'
ELSE
IF jour = '08' then
transj := 'huit'
ELSE
IF jour = '09' then
transj := 'neuf'
ELSE
IF jour = '10' then
transj := 'dix'
ELSE
IF jour = '11' then
transj := 'onze'
ELSE
IF jour = '12' then
transj := 'douze'
ELSE
IF jour = '13' then
transj := 'treize'
ELSE
IF jour = '14' then
transj := 'quatorze'
ELSE
IF jour = '15' then
transj := 'quinze'
ELSE
IF jour = '16' then
transj := 'seize'
ELSE
IF jour = '17' then
transj := 'diz-sept'
ELSE
IF jour = '18' then
transj := 'dix-huit'
ELSE
IF jour = '19' then
transj := 'dix-neuf'
ELSE
IF jour = '20' then
transj := 'vingt'
ELSE
IF jour = '21' then
transj := 'vingt et un'
ELSE
IF jour = '22' then
transj := 'vingt-deux'
ELSE
IF jour = '23' then
transj := 'vingt-trois'
ELSE
IF jour = '24' then
transj := 'vingt-quatre'
ELSE
IF jour = '25' then
transj := 'vingt-cinq'
ELSE
IF jour = '26' then
transj := 'vingt-six'
ELSE
IF jour = '27' then
transj := 'vingt-sept'
ELSE
IF jour = '28' then
transj := 'vingt-huit'
ELSE{Prb annee bisextille}
IF jour = '29' then
IF mois = '02' then
IF annee = '1996' then
transj :='vingt-neuf'
else if annee = '2000' then
transj :='vingt-neuf'
else if annee = '2004' then
transj :='vingt-neuf'
else writeln('le jour est incorrect')
else transj :='vingt-neuf'
ELSE
IF jour = '30' then
IF mois = '02' then
writeln ('le jour est incorrect')
Else transj := 'trente'
ELSE{Prb mois a 31 jours}
IF jour = '31' then
IF mois = '02' then
Writeln('le jour est incorrect')
Else if mois = '04' then
Writeln('le jour est incorrect')
Else if mois = '06' then
Writeln('le jour est incorrect')
Else if mois = '09' then
Writeln('le jour est incorrect')
Else if mois = '11' then
Writeln('le jour est incorrect')
Else transj :='trente et un'
ELSE writeln('le jour est incorrect');
end;{fin de la traduction du mois}
WRITELN (transj, ' ', transm, ' ', transa);
Readln;
end.
Conclusion
C'est une vraie usine a gaz mais c'est de mon niveau
Sources du même auteur
Sources de la même categorie
Commentaires et avis
|
Derniers Blogs
[TECHDAYS2012] OUI J'Y SERAI![TECHDAYS2012] OUI J'Y SERAI! par JeremyJeanson
Bonsoir, Certes, je l'annonce avec un peu de retard, mais je serai effectivement au Techdays demain. Comme l'an dernier, je participerai au programme ATE (Ask The Expert). Si vous avez des questions Workflow, WCF, AppFabric ou plus généralement .net, n'hé...
Cliquez pour lire la suite de l'article par JeremyJeanson TFS INTEGRATION TOOLS - SUIVI DES SYNCHRONISATIONS AVEC REPORTING SERVICESTFS INTEGRATION TOOLS - SUIVI DES SYNCHRONISATIONS AVEC REPORTING SERVICES par vfabing
Afin de s'assurer du bon fonctionnement des différentes synchronisations effectuées par les TFS Integration Tools, 2 rapports sont présents dès l'installation. Il suffit alors d'effectuer les manipulations suivantes pour pouvoir les visualiser : Loca...
Cliquez pour lire la suite de l'article par vfabing CSS CONTENT STATE SELECTORS (PERSONNAL DRAFT)CSS CONTENT STATE SELECTORS (PERSONNAL DRAFT) par FREMYCOMPANY
Bonjour à tous, Je viens de publier une proposition comprenant 5 pseudo-classes pour le CSS Working Group ayant trait à l'état de chargement d'un élément (ex: IMG,VIDEO,AUDIO,OBJECT pour l'HTML.). Si le c½ur vous en dit, vous pouvez retrouver cette p...
Cliquez pour lire la suite de l'article par FREMYCOMPANY MBA : POURQUOI FAIRE ET COMMENT LE CHOISIR ?MBA : POURQUOI FAIRE ET COMMENT LE CHOISIR ? par ROMELARD Fabrice
Formation initiale Durant la formation, le découpage classique est le suivant (je donnerai les équivalences Suisse lorsque je les connaîtrais) : Ecole primaire jusqu'au Collège : Formation générale permettant d'obtenir les méthodes...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice Y'A DES ERREURS QUI PEUVENT RENDRE LE DéVELOPPEUR VIOLENTY'A DES ERREURS QUI PEUVENT RENDRE LE DéVELOPPEUR VIOLENT par Aleks
Quand on a ce genre d'erreur sans log :
Et bas on a juste envie de choper le gas de Microsoft qu'a développé ça et lui foutre des baffes de Coboye ! ...
Cliquez pour lire la suite de l'article par Aleks
Logiciels
Academy System (17.2.1.0)ACADEMY SYSTEM (17.2.1.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System Easy-Planning (1.0.0.1)EASY-PLANNING (1.0.0.1)Basé sur les mêmes principes que MyPlanning, Easy-Planning permet de créer des plannings sous la ... Cliquez pour télécharger Easy-Planning COLLECTOR PLUS (3.00B)COLLECTOR PLUS (3.00B)COLLECTOR PLUS version 3.00B est un logiciel utilisant une base de données alimentée par :
- L... Cliquez pour télécharger COLLECTOR PLUS PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO LettresFaciles 2011 (8.0.0.1)LETTRESFACILES 2011 (8.0.0.1)LettresFaciles est un logiciel facilitant la création et la rédaction de lettres types.
Son inte... Cliquez pour télécharger LettresFaciles 2011
|