2024-02-21 13:07:17 +00:00
|
|
|
#include <stdio.h>
|
2024-02-21 13:24:35 +00:00
|
|
|
|
2024-02-21 13:07:17 +00:00
|
|
|
int main() {
|
|
|
|
int text;
|
2024-02-21 15:38:18 +00:00
|
|
|
int lines_count = 0;
|
2024-02-17 10:42:30 +00:00
|
|
|
|
2024-02-21 13:07:17 +00:00
|
|
|
while ((text = getchar()) != EOF) {
|
2024-02-21 14:24:42 +00:00
|
|
|
if (text == '\n') {
|
|
|
|
putchar('\n');
|
2024-02-21 15:38:18 +00:00
|
|
|
lines_count++;
|
2024-02-21 14:24:42 +00:00
|
|
|
} else if (text == '\t') {
|
|
|
|
putchar('\t');
|
|
|
|
continue;
|
2024-02-21 14:30:19 +00:00
|
|
|
} else if ((text >= 'a' && text <= 'z') || (text >= 'A' && text <= 'Z')) {
|
|
|
|
putchar(text ^ ' ');
|
2024-02-21 14:44:32 +00:00
|
|
|
} else if ((text >= 32 && text < 127) || text == 9) {
|
2024-02-21 14:17:07 +00:00
|
|
|
putchar(text);
|
2024-02-21 14:44:32 +00:00
|
|
|
} else {
|
|
|
|
continue;
|
2024-02-21 13:07:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-21 15:38:18 +00:00
|
|
|
printf("\nLines count: %d\n", lines_count);
|
2024-02-21 14:44:32 +00:00
|
|
|
|
2024-02-21 13:07:17 +00:00
|
|
|
return 0;
|
2024-02-21 15:38:18 +00:00
|
|
|
}
|