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