30 lines
561 B
C
30 lines
561 B
C
#include <stdio.h>
|
|
#include <ctype.h>
|
|
|
|
int main() {
|
|
int ch;
|
|
int visibleChars = 0;
|
|
|
|
printf("Zadajte text (ukoncite vstup s Ctrl+D):\n");
|
|
|
|
while ((ch = getchar()) != EOF) {
|
|
if (islower(ch)) {
|
|
ch = toupper(ch);
|
|
} else if (isupper(ch)) {
|
|
ch = tolower(ch);
|
|
}
|
|
|
|
if (isprint(ch) || ch == '\n') {
|
|
putchar(ch);
|
|
if (ch != '\n') {
|
|
visibleChars++;
|
|
}
|
|
}
|
|
}
|
|
|
|
printf("\nPocet načítaných riadkov: %d\n", visibleChars);
|
|
|
|
return 0;
|
|
}
|
|
|