From 84bcb9fb2e0980dcb008fc40ec45e00576619002 Mon Sep 17 00:00:00 2001 From: PanSi21 Date: Sun, 5 Jan 2025 00:57:02 +0100 Subject: [PATCH] Aggiorna test.c --- test.c | 49 +++++++++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/test.c b/test.c index 8e57a1c..aae95c5 100644 --- a/test.c +++ b/test.c @@ -1,39 +1,32 @@ - #include #include #include -/* run this program using the console pauser or add your own getch, system("pause") or input loop */ +void parseH(char *p); +void parseL(char *p); -int fibonacci(int argc, char *argv[]) { - - char c[] = "qwertyuiopasdfghjkllzxcvbnm123456789mnbvcxzlkjhgfdsapoiuytrewq1234567890"; - - for(int a=0;a<100000;a++){ - parseH(&c); - parseL(&c); - printf("%s",c); - } - - return 0; -} - - -void parseH(char *p){ - int ln=strlen(p); - for(int a=0; a96){ - p[a]=p[a]-32; - } +void testicolo(char *input, char *output) { + strcpy(output, input); + for (int a = 0; a < 1000; a++) { + parseH(output); + parseL(output); } - } -void parseL(char *p){ - int ln=strlen(p); - for(int a=0; a64){ - p[a]=p[a]+32; +void parseH(char *p) { + int ln = strlen(p); + for (int a = 0; a < ln; a++) { + if (p[a] < 123 && p[a] > 96) { + p[a] = p[a] - 32; + } + } +} + +void parseL(char *p) { + int ln = strlen(p); + for (int a = 0; a < ln; a++) { + if (p[a] < 91 && p[a] > 64) { + p[a] = p[a] + 32; } } }