Problème exécution programme PASCAL
Fermé
zorg
-
12 août 2006 à 04:08
jisisv Messages postés 3645 Date d'inscription dimanche 18 mars 2001 Statut Modérateur Dernière intervention 15 janvier 2017 - 12 août 2006 à 04:59
jisisv Messages postés 3645 Date d'inscription dimanche 18 mars 2001 Statut Modérateur Dernière intervention 15 janvier 2017 - 12 août 2006 à 04:59
A voir également:
- Problème exécution programme PASCAL
- Ce programme est écrit en python. il construit un mot secret dans une variable mais il ne l'affiche pas. modifiez-le pour qu'il affiche le mot secret. exécutez-le. quel est ce mot secret ? ✓ - Forum Python
- Turbo pascal download - Télécharger - Édition & Programmation
- Frequence programme national ✓ - Forum Messagerie
- Programme demarrage windows 10 - Guide
- Erreur d'execution 1004 - Forum Programmation
2 réponses
Bon en fait je me réponds à moi même ^^
Voici le bon programme en plus simple :
program conversion_minuscules_en_majuscules ;
Merci !!
Voici le bon programme en plus simple :
program conversion_minuscules_en_majuscules ;
var
chaine : string[50] ;
i, x : integer ;
c : char ;
BEGIN
writeln ('Entrez votre phrase !') ;
readln (chaine) ;
for i := 1 to length(chaine) do
begin
if (chaine[i]>='a') and (chaine[i]<='z') then
begin
c := chaine[i] ;
x := (ord(c))-32 ;
c := chr(x) ;
chaine[i] := c ;
end ;
end ;
writeln ('Voici votre nouvelle phrase !') ;
writeln (chaine) ;
readln
END.
Merci !!
jisisv
Messages postés
3645
Date d'inscription
dimanche 18 mars 2001
Statut
Modérateur
Dernière intervention
15 janvier 2017
947
12 août 2006 à 04:59
12 août 2006 à 04:59
Ceci fonctionne
Johan
johand@horus:~/src/pascal$ cat toupper.p
program conversion_minuscules_en_majuscules ;
var
chaine : string[50] ;
i : integer ;
c : char ;
x : integer ;
function isUpper(c : char) : boolean;
begin
isUpper := (chaine[i] >='a') and (chaine[i]<='z');
end;
BEGIN
writeln ('Entrez votre phrase !') ;
readln (chaine) ;
for i := 1 to length(chaine) do
begin
if isUpper(chaine[i]) then
begin
c := chaine[i] ;
x := (ord(c))-32 ;
c := chr(x) ;
chaine[i] := c ;
end ;
end ;
writeln ('Voici votre nouvelle phrase !') ;
writeln (chaine) ;
end.
johand@horus:~/src/pascal$ fpc toupper.p
Free Pascal Compiler version 2.0.0 [2005/09/09] for i386
Copyright (c) 1993-2005 by Florian Klaempfl
Target OS: Linux for i386
Compiling toupper.p
Linking toupper
33 Lines compiled, 0.1 sec
johand@horus:~/src/pascal$ ./toupper
Entrez votre phrase !
Hello World !
Voici votre nouvelle phrase !
HELLO WORLD !
Johan