• Aucun résultat trouvé

type tab=array[1..20] of string

N/A
N/A
Protected

Academic year: 2022

Partager "type tab=array[1..20] of string"

Copied!
1
0
0

Texte intégral

(1)

program sujet2;

uses wincrt;

type

tab=array[1..20] of string;

var n:integer;

t:tab;

function verif(ch:string):boolean;

var i:integer;

test:boolean;

begin i:=0;

repeat i:=i+1;

if ch[i] in ['A'..'Z',' '] then test:=true else test:= false;

until (test=false) or (i=length(ch));

verif :=test;

end;

procedure saisie(var t:tab;var n:integer);

var i:integer;

begin repeat write('N= ');

readln(n);

until n in [3..20];

for i:= 1 to n do repeat

write('t[',i,']= ');

readln(t[i]);

until (verif(t[i])) and (length(t[i])in [1..20]);

end;

function sommevoy(ch:string):integer;

var

i,s:integer;

begin s:=0;

for i:=1 to length(ch) do

if ch[i] in ['A','E','I','O','Y','U'] then s:=s+1;

sommevoy:=s;

end;

procedure maxvoy(t:tab);

var

i,x,max:integer;

begin max:=0;

for i:=1 to n do begin

x:=sommevoy(t[i]);

if x>max then max:=x;

end;

writeln('Le plus grand est ',max);

writeln;

for i:=1 to n do

if sommevoy(t[i])=max then writeln(t[i]);

end;

begin saisie(t,n);

maxvoy(t);

end.

Références

Documents relatifs

Reproduire l’exercice du calcul du nombre d’occurrences d’un élément donné dans un tableau sous la forme d’une fonction récursive... Autrement dit, le premier caractère

Pour piloter cette expansion de techniques, parfois très pointues au sein des laboratoires, les professionnels de la biologie que sont les Techniciens en Analyses Biomédicales se

[r]

TABLEAU DE CORRESPONDANCE CARACTERES LATINS - GRECS DANS LA POLICE GREEK.TTF. Les nombres représentent les

Si vous êtes enceinte ou que vous allaitez, si vous pensez être enceinte ou planifiez une grossesse, demandez conseil à votre médecin ou pharmacien avant de prendre ce médicament..

An integer array C is the minimal-cover (resp. maximal-cover) array of y if C [i] is the minimal (resp. maximal) length of covers of y[0.. i], or zero if no

In Datasheet view, you can edit fields, add and delete data, and search for data.. In Access 2007, you

[r]