pvjc24/cv1/program.c

26 lines
424 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) {
2024-02-21 13:28:35 +00:00
if (c == '\n') {
lines_count++;
} else if (c >= 'a' && c <= 'z') {
2024-02-21 13:04:04 +00:00
c = c - 'a' + 'A';
} else if (c >= 'A' && c <= 'Z') {
2024-02-21 13:28:35 +00:00
2024-02-21 13:04:04 +00:00
c = c - 'A' + 'a';
}
2024-02-21 13:28:35 +00:00
putchar(c);
2024-02-21 13:04:04 +00:00
}
2024-02-21 13:28:35 +00:00
printf("Lines Count: %d\n", lines_count);
2024-02-21 13:04:04 +00:00
return 0;
2024-02-17 19:30:32 +00:00
}