mirror of
https://gitlab.gwdg.de/j.hahn02/university.git
synced 2026-01-01 06:44:25 -05:00
refactor various files
This commit is contained in:
22
S1/GdCP/uebung/sms.c
Normal file
22
S1/GdCP/uebung/sms.c
Normal file
@@ -0,0 +1,22 @@
|
||||
#include<stdio.h>
|
||||
#include<ctype.h>
|
||||
#include<string.h>
|
||||
|
||||
int main() {
|
||||
char s[161], m1[161], m2[161];
|
||||
int c1 = 0, c2 = 0;
|
||||
|
||||
fgets(s, sizeof(s), stdin);
|
||||
|
||||
for (int i = 0; i < strlen(s); i++) {
|
||||
if (isalpha(s[i])) {
|
||||
if (isupper(s[i])) {
|
||||
m1[c1++] = s[i];
|
||||
} else m2[c2++] = s[i];
|
||||
}
|
||||
|
||||
}
|
||||
printf("Nachricht an Toni: %s\n", m1);
|
||||
printf("Nachricht an Tomke: %s\n", m2);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user