diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-07-26 23:17:36 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-07-26 23:17:36 +0200 |
| commit | 8ec5431354bdb582455e8c32758098c5a0fdada2 (patch) | |
| tree | 480c68814f822439850029df0e0249a2cafb8177 /exam_final/subjects/11-0-ord_alphlong | |
| parent | 475449dd4b1f3308bac6f72c34d87812216a0738 (diff) | |
| download | piscine-8ec5431354bdb582455e8c32758098c5a0fdada2.tar.gz piscine-8ec5431354bdb582455e8c32758098c5a0fdada2.tar.bz2 piscine-8ec5431354bdb582455e8c32758098c5a0fdada2.zip | |
exam final
Diffstat (limited to 'exam_final/subjects/11-0-ord_alphlong')
| -rw-r--r-- | exam_final/subjects/11-0-ord_alphlong/examples.txt | 18 | ||||
| -rw-r--r-- | exam_final/subjects/11-0-ord_alphlong/subject.en.txt | 40 | ||||
| -rw-r--r-- | exam_final/subjects/11-0-ord_alphlong/subject.fr.txt | 41 |
3 files changed, 99 insertions, 0 deletions
diff --git a/exam_final/subjects/11-0-ord_alphlong/examples.txt b/exam_final/subjects/11-0-ord_alphlong/examples.txt new file mode 100644 index 0000000..c89eefd --- /dev/null +++ b/exam_final/subjects/11-0-ord_alphlong/examples.txt @@ -0,0 +1,18 @@ +$>./ord_alphlong +$ +$>./ord_alphlong "De son baton il frappa la pierre et l eau jaillit" | cat -e +l$ +De et il la$ +eau son$ +baton$ +frappa pierre$ +jaillit$ +$>./ord_alphlong "A a b B cc ca cd" | cat -e +A a b B$ +ca cc cd$ +$>./ord_alphlong "Pour l Imperium de l humanite" | cat -e +l l$ +de$ +Pour$ +humanite Imperium$ +$> diff --git a/exam_final/subjects/11-0-ord_alphlong/subject.en.txt b/exam_final/subjects/11-0-ord_alphlong/subject.en.txt new file mode 100644 index 0000000..118a1ca --- /dev/null +++ b/exam_final/subjects/11-0-ord_alphlong/subject.en.txt @@ -0,0 +1,40 @@ +Assignment name : ord_alphlong +Expected files : *.c, *.h +Allowed functions: write, malloc, free +-------------------------------------------------------------------------------- + +Write a program that takes a string as a parameter and prints its words sorted +in length order then in alphabetical order: when words are alphabetically +equals (for example aA and Aa), original order must remain (lower and upper +case are the same in alphabetical order). If there are duplicates, they must +remain. + +If number of parameters is different from 1, the program prints +\n. + +There will be only spaces, tabs and alphanumeric caracters in strings. + +You'll print only one space between each word. Nothing before the first and +after the last word of each line. + +Examples: + +$>./ord_alphlong +$ +$>./ord_alphlong "After all this time Always said Snape" | cat -e +all$ +said this time$ +After Snape$ +Always$ +$>./ord_alphlong "A a b B cc ca cd" | cat -e +A a b B$ +ca cc cd$ +$>./ord_alphlong "Never take a gamble you are not prepared to lose" | cat -e +a$ +to$ +are not you$ +lose take$ +Never$ +gamble$ +prepared$ +$> diff --git a/exam_final/subjects/11-0-ord_alphlong/subject.fr.txt b/exam_final/subjects/11-0-ord_alphlong/subject.fr.txt new file mode 100644 index 0000000..047ea4c --- /dev/null +++ b/exam_final/subjects/11-0-ord_alphlong/subject.fr.txt @@ -0,0 +1,41 @@ +Assignment name : ord_alphlong +Expected files : *.c, *.h +Allowed functions: write, malloc, free +-------------------------------------------------------------------------------- + +Écrire un programme qui prend en paramètre une chaîne de caractères et qui +affiche les mots de cette chaîne par ordre de longueur puis dans l'ordre +alphabétique, avec une petite variante: En cas d'égalité alphabétique (par +exemple aA et Aa) les mots doivent rester dans l'ordre où ils +étaient dans la chaîne d'origine (Les majuscules et minuscules sont identiques +dans l'ordre alphabétique). En cas de doublons, les doublons sont conservés. + +Si le nombre de paramètres transmis est différent de 1, le programme affiche +\n. + +Dans les chaînes, il n'y aura que des espaces, des tabulations et des +caractères alphanumériques. + +Vous n'afficherez qu'un espace entre les mots. Aucun avant le premier ni après +le dernier de chaque ligne. + +Exemples: + +$>./ord_alphlong +$ +$>./ord_alphlong "De son baton il frappa la pierre et l eau jaillit" | cat -e +l$ +De et il la$ +eau son$ +baton$ +frappa pierre$ +jaillit$ +$>./ord_alphlong "A a b B cc ca cd" | cat -e +A a b B$ +ca cc cd$ +$>./ord_alphlong "Pour l Imperium de l humanite" | cat -e +l l$ +de$ +Pour$ +humanite Imperium$ +$> |
