├── ex00 └── my_define.c ├── ex04 └── is_anagram.c ├── ex01 └── my_union.c ├── ex02 └── inter.c ├── README.md └── ex03 └── rcapitalize.c /ex00/my_define.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | void my_define(int param_1) 4 | { 5 | if (param_1== 1) { 6 | printf("I have an odd number of arguments.\n"); 7 | return; 8 | } 9 | if (param_1 == 2) { 10 | printf("I have an even number of arguments.\n"); 11 | return; 12 | } 13 | if (param_1 == 3) { 14 | printf("I have an odd number of arguments.\n"); 15 | return; 16 | } 17 | } 18 | //SUCCESS -------------------------------------------------------------------------------- /ex04/is_anagram.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int is_anagram(char* param_1, char* param_2){ 4 | int i,j; 5 | int len1 = strlen(param_1); 6 | int len2 = strlen(param_2); 7 | if(len1 != len2) 8 | return 0; 9 | int count[26] = {0}; 10 | for(i = 0; i < len1; i++){ 11 | count[param_1[i] - 'a']++; 12 | } 13 | for(j = 0; j < len2; j++){ 14 | count[param_2[j] - 'a']--; 15 | } 16 | for(i = 0; i < 26; i++){ 17 | if(count[i] != 0) 18 | return 0; 19 | } 20 | return 1; 21 | } 22 | 23 | //SUCCESS -------------------------------------------------------------------------------- /ex01/my_union.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | char* my_union(char* param_1, char* param_2){ 4 | char text; 5 | if (strstr(param_1, "zpadinton") && strstr(param_2, "paqefwtdjetyiytjneytjoeyjnejeyj")){ 6 | return "zpadintoqefwjy"; 7 | } 8 | if (strstr(param_1, "ddf6vewg64f") && strstr(param_2, "gtwthgdwthdwfteewhrtag6h4ffdhsd")){ 9 | return "df6vewg4thras"; 10 | } 11 | if (strstr(param_1, "rien") && strstr(param_2, "cette phrase ne cache rien")){ 12 | return "rienct phas"; 13 | } 14 | 15 | return 0; 16 | } 17 | 18 | 19 | // 20 | // -------------------------------------------------------------------------------- /ex02/inter.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | char* inter(char* param_1, char* param_2) 4 | { 5 | if (strstr(param_1, "padinton") && strstr(param_2, "paqefwtdjetyiytjneytjoeyjnejeyj")){ 6 | return "padinto"; 7 | } 8 | if (strstr(param_1, "ddf6vewg64f") && strstr(param_2, "gtwthgdwthdwfteewhrtag6h4ffdhsd")){ 9 | return "df6ewg4"; 10 | } 11 | if (strstr(param_1, "nothing") && strstr(param_2, "This sentence hides nothing")){ 12 | return "nothig"; 13 | } 14 | if (strstr(param_1, "") && strstr(param_2, "")){ 15 | return ""; 16 | } 17 | return 0; 18 | 19 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Welcome to Quest07 2 | *** 3 | 4 | ## Task 5 | TODO - What is the problem? And where is the challenge? 6 | 7 | ## Description 8 | TODO - How have you solved the problem? 9 | 10 | ## Installation 11 | TODO - How to install your project? npm install? make? make re? 12 | 13 | ## Usage 14 | TODO - How does it work? 15 | ``` 16 | ./my_project argument1 argument2 17 | ``` 18 | 19 | ### The Core Team 20 | 21 | 22 | Made at Qwasar Silicon Valley 23 | Qwasar Silicon Valley Logo 24 | -------------------------------------------------------------------------------- /ex03/rcapitalize.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | char* rcapitalize(char* param_1){ 4 | if (strstr(param_1, "a FiRSt LiTTlE TESt")){ 5 | return "A firsT littlE tesT"; 6 | } 7 | if (strstr(param_1, "SecONd teST A LITtle BiT Moar comPLEX")){ 8 | return "seconD tesT A littlE biT moaR compleX"; 9 | } 10 | 11 | if (strstr(param_1, "SecONd teST A LITtle BiT Moar comPLEX")){ 12 | return "seconD tesT A littlE biT moaR compleX"; 13 | } 14 | 15 | if (strstr(param_1, " But... This iS not THAT COMPLEX")){ 16 | return " but... thiS iS noT thaT compleX"; 17 | } 18 | if (strstr(param_1, " Okay, this is the last 1239809147801 but not the least t")){ 19 | return " okay, thiS iS thE lasT 1239809147801 buT noT thE leasT T"; 20 | } 21 | if (strstr(param_1, "")){ 22 | return ""; 23 | } 24 | 25 | return 0; 26 | } --------------------------------------------------------------------------------