Probléme Algorithme
Fermé
gui175
Messages postés
6
Date d'inscription
dimanche 6 mars 2011
Statut
Membre
Dernière intervention
1 décembre 2011
-
1 déc. 2011 à 18:37
ccm81 Messages postés 10559 Date d'inscription lundi 18 octobre 2010 Statut Membre Dernière intervention 24 mars 2023 - 1 déc. 2011 à 20:33
ccm81 Messages postés 10559 Date d'inscription lundi 18 octobre 2010 Statut Membre Dernière intervention 24 mars 2023 - 1 déc. 2011 à 20:33
A voir également:
- Probléme Algorithme
- Ppcm algorithme - Forum Programmation
- Pgcd algorithme - Forum Programmation
- Ecrire un algorithme qui permet de resoudre ax²+bx+c=0 - Forum Algorithmes / Méthodes
- Logiciel algorithme gratuit - Télécharger - Édition & Programmation
- Algorithme excel - Forum VB / VBA
3 réponses
Pacorabanix
Messages postés
3245
Date d'inscription
jeudi 23 août 2007
Statut
Membre
Dernière intervention
19 mai 2013
658
1 déc. 2011 à 20:19
1 déc. 2011 à 20:19
il ne te manque pas un bloc begin end qui entoure le contenu de ta boucle for ?
gui175
Messages postés
6
Date d'inscription
dimanche 6 mars 2011
Statut
Membre
Dernière intervention
1 décembre 2011
1 déc. 2011 à 20:29
1 déc. 2011 à 20:29
NIckel merci merci c'était ça :)
ccm81
Messages postés
10559
Date d'inscription
lundi 18 octobre 2010
Statut
Membre
Dernière intervention
24 mars 2023
2 337
1 déc. 2011 à 20:33
1 déc. 2011 à 20:33
bonsoir
une petite fonction qui convertit un "string binaire" en "word décimal"
bonne suite
une petite fonction qui convertit un "string binaire" en "word décimal"
program bindec;
uses crt;
var bin : string;
dec : word;
function bintodec(b:string):word;
begin
if length(b) = 1
then
bintodec := ord(b[1])-48
else
bintodec := ord(b[length(b)])-48+2*bintodec(copy(b,1,length(b)-1));
end;
begin
write('b = ');readln(bin);
dec := bintodec(bin);
writeln('d = ',dec)
end.
bonne suite