pvjc24/cv1/program.c

30 lines
544 B
C
Raw Normal View History

2024-02-21 13:04:04 +00:00
#include <stdio.h>
2024-02-17 19:30:32 +00:00
2024-02-21 13:04:04 +00:00
int main() {
int c = 0;
2024-02-21 13:21:57 +00:00
int lines_count = 0;
2024-02-21 13:04:04 +00:00
while ((c = getchar()) != EOF) {
if (c >= 'a' && c <= 'z') {
c = c - 'a' + 'A';
} else if (c >= 'A' && c <= 'Z') {
c = c - 'A' + 'a';
} else if (c == '\n') {
2024-02-21 13:21:57 +00:00
lines_count++;
2024-02-21 13:04:04 +00:00
}
if (c != '\n') {
putchar(c);
}
}
// Po načítaní všetkých znakov vypíš počet riadkov
2024-02-21 13:21:57 +00:00
printf("\nLines Count: %d\n", lines_count);
2024-02-21 13:04:04 +00:00
return 0;
2024-02-17 19:30:32 +00:00
}
2024-02-21 13:04:04 +00:00