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