This commit is contained in:
Macko 2024-02-22 14:42:41 +01:00
parent 023da99602
commit d22428779d

View File

@ -1,26 +1,26 @@
#include <stdio.h> #include <stdio.h>
#include <ctype.h>
int main() { int main() {
int lines_count = 0;
int c; int c;
int lines = 0;
while ((c = getchar()) != EOF) { while ((c = getchar()) != EOF) {
if (islower(c)) { if (c >= 'a' && c <= 'z') {
putchar(toupper(c)); c -= 32;
} else if (isupper(c)) { } else if (c >= 'A' && c <= 'Z') {
putchar(tolower(c)); c += 32;
} else {
putchar(c);
if (c == '\n') {
lines_count++;
} }
if (c == '\n') {
lines++;
}
if (c >= 32 && c <= 126) {
putchar(c);
} }
} }
printf("Počet načítaných riadkov: %d\n", lines_count); printf("\nPočet načítaných riadkov: %d\n", lines);
return 0; return 0;
} }