Q2
This commit is contained in:
@@ -1,14 +1,23 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
void affiche_vache() {
|
void affiche_vache(char yeux[3]) {
|
||||||
printf(" \\ ^__^\n");
|
printf(" \\ ^__^\n");
|
||||||
printf(" \\ (oo)\\_______\n");
|
printf(" \\ (%s)\\_______\n", yeux);
|
||||||
printf(" (__)\\ )\\/\\\n");
|
printf(" (__)\\ )\\/\\\n");
|
||||||
printf(" ||----w |\n");
|
printf(" ||----w |\n");
|
||||||
printf(" || ||\n");
|
printf(" || ||\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main(int argc, char *argv[]) {
|
||||||
affiche_vache();
|
char yeux[3] = "oo";
|
||||||
|
|
||||||
|
if (argc == 3 &&
|
||||||
|
(strcmp(argv[1], "-e") == 0 || strcmp(argv[1], "--eyes") == 0)) {
|
||||||
|
strncpy(yeux, argv[2], 2);
|
||||||
|
yeux[2] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
affiche_vache(yeux);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user