skuska
This commit is contained in:
parent
d79643777b
commit
e0d6b4ed32
@ -1,22 +1,21 @@
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
int main() {
|
||||
char ch;
|
||||
int 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);
|
||||
if (!((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z')) && !(ch >= 32 && ch <= 126)) {
|
||||
continue; // Skip control characters and non-printable characters
|
||||
}
|
||||
putchar((ch >= 'a' && ch <= 'z') ? (ch - 32) : (ch + 32));
|
||||
}
|
||||
}
|
||||
|
||||
printf("\nLines count: %d\n", line_count);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user