This commit is contained in:
2026-01-29 18:42:21 +01:00
parent c7b1bc12a7
commit 2ae8d93f16
3 changed files with 78 additions and 0 deletions
@@ -0,0 +1,50 @@
#include <stdlib.h>
#include <stdio.h>
char *my_weirddup(char *src){
if(src == NULL) return NULL;
int index = 0;
while(*(src)){
index ++;
src ++;
}
char *str = malloc(index + 1);
if(str == NULL) return NULL;
//src = 0;
char lettre = ' ';
index = 0;
while (*src){
lettre = *src;
//maj
if (lettre > 64 && lettre < 91){
if (lettre == 'Z') lettre = 'A';
else lettre += 1;
}
//min
else if (lettre > 97 && lettre < 124 ){
if (lettre == 'z')lettre = 'a';
else lettre += 1;
}
*str = lettre;
src ++;
str ++;
}
return str;
}
int main(){
printf("%s",my_weirddup("abb"));
}