This commit is contained in:
Oleksandr Vyshniakov 2025-02-18 17:52:48 +01:00
parent 480138a199
commit 4164b2e021
2 changed files with 23 additions and 0 deletions

Binary file not shown.

23
a1/program.c Normal file
View File

@ -0,0 +1,23 @@
#include <stdio.h>
#include <ctype.h>
void funkcia (int c, int *line_count) {
if (c == '\n') {
(*line_count)++;
putchar(c);
} else if (isalpha(c)) {
putchar(islower(c) ? toupper(c) : tolower(c));
} else if (isprint(c)) {
putchar(c);
}
}
int main() {
int c;
int c2 = 0;
while ((c = getchar()) !=EOF) {
funkcia(c, &c2);
}
printf("\nHow many strings: %d\n", c2);
return 0;
}