pvjc24/cv1/program.c

27 lines
442 B
C
Raw Permalink Normal View History

2024-02-21 09:37:36 +00:00
#include <stdio.h>
int main() {
2024-02-22 13:34:00 +00:00
int c;
2024-02-22 13:42:41 +00:00
int lines = 0;
2024-02-21 09:37:36 +00:00
while ((c = getchar()) != EOF) {
2024-02-22 13:42:41 +00:00
if (c >= 'a' && c <= 'z') {
c -= 32;
} else if (c >= 'A' && c <= 'Z') {
c += 32;
}
if (c == '\n') {
lines++;
}
if (c >= 32 && c <= 126) {
2024-02-22 13:34:00 +00:00
putchar(c);
2024-02-21 09:37:36 +00:00
}
}
2024-02-22 13:42:41 +00:00
printf("\nPočet načítaných riadkov: %d\n", lines);
2024-02-21 09:37:36 +00:00
return 0;
2024-02-22 13:42:41 +00:00
}