21 lines
467 B
C
21 lines
467 B
C
#include <stdio.h>
|
|
|
|
int main() {
|
|
char ch;
|
|
int line_count = 0;
|
|
|
|
while ((ch = getchar()) != EOF) {
|
|
if (ch == '\n') {
|
|
line_count++;
|
|
} else if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) {
|
|
putchar((ch >= 'a' && ch <= 'z') ? (ch - 32) : (ch + 32));
|
|
}
|
|
|
|
if (ch == '\n') {
|
|
printf("\nLines count: %d\n", line_count);
|
|
line_count = 0;
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
} |