refactor various files

This commit is contained in:
2025-04-28 16:59:44 +02:00
parent 5049c3ec13
commit 05c830c8e2
97 changed files with 513 additions and 2676 deletions

22
S1/GdCP/uebung/a01.c Normal file
View File

@@ -0,0 +1,22 @@
#include<stdlib.h>
#include<ctype.h>
#include<string.h>
void pop(char *s, char *p) {
int l = strlen(s) - 1;
for (int i = p - s; i < l; i++) s[i] = s[i+1];
s[l] = '\0';
}
int strclean(char *t) {
if (!t) return -1;
int count = 0, ind = 0;
while (t[ind] != '\0') {
if (!isgraph(t[ind])) {
pop(t, t + ind); count++;
} else ind++;
}
return count;
}