21 lines
497 B
C
21 lines
497 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') || (ch >= 'a' && ch <= 'z')) && !(ch >= 32 && ch <= 126)) {
|
|
continue;
|
|
}
|
|
putchar((ch >= 'a' && ch <= 'z') ? (ch - 32) : (ch + 32));
|
|
}
|
|
}
|
|
|
|
printf("\nLines count: %d\n", line_count);
|
|
|
|
return 0;
|
|
} |