Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program poids_mot;
- uses wincrt;
- var
- ch:string;
- n,i:integer;
- procedure poids(c:string;var k:integer);
- begin
- k:=0;
- for i:=1 to length(c) do
- begin
- if ch[i]='a' then k:=k+1*i
- else if ch[i]='e' then k:=k+5*i
- else if ch[i]='i' then k:=k+5*ord('i')
- else if ch[i]='o' then k:=k+5*ord('o')
- else if ch[i]='u' then k:=k+5*ord('u')
- else if ch[i]='y' then k:=k+5*ord('y')
- else k:=k;
- end;
- end;
- begin
- writeln('ecrire un mot');
- readln(ch);
- poids(ch,n);
- writeln('le poids du mot ',ch,' est: ',n);
- writeln('Press <Enter> To Quit');
- readln();
- end.
Advertisement
Add Comment
Please, Sign In to add comment