Thông tin

Hạn chót Không có hạn chót
Giới hạn nộp bài Không có giới hạn

Đăng nhập

[6.5] Repet [Suppl.]

Définissez une fonction répondant aux spécifications suivantes :

\begin{align*} & \text{Nom} & & \texttt{repet n x} \\ & \text{Type} & & \texttt{Int -> a -> [a]} \\ & \text{Conditions} & & n \geq 0 \\ & \text{Résultat} & & \text{la liste contenant } n \text{ fois l'élément } x \text{ (ainsi, } \texttt{repet 3 6} \text{ donnera la liste } \texttt{[6,6,6]} \text{)} \end{align*}
ATTENTION!
Les fonctions demandées doivent être implémentées en utilisant foldr et/ou foldl, sans récursivité explicite.

Le code