pvjc24/cv1/program.c

32 lines
501 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:35:41 +00:00
if (c >= 'a' && c <= 'z') {
2024-02-21 13:04:04 +00:00
c = c - 'a' + 'A';
}
2024-02-21 13:28:35 +00:00
2024-02-21 13:35:41 +00:00
else if (c >= 'A' && c <= 'Z') {
c = c - 'A' + 'a';
}
else if (c == '\n') {
lines_count++;
}
2024-02-21 13:28:35 +00:00
putchar(c);
2024-02-21 13:04:04 +00:00
}
2024-02-21 13:35:41 +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
}