pvjc25/a1/program.c

24 lines
449 B
C
Raw Normal View History

2025-02-18 16:52:48 +00:00
#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);
}
2025-02-18 17:05:26 +00:00
printf("\nLines count: %d\n", c2);
2025-02-18 16:52:48 +00:00
return 0;
}