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