pvjc25/a1/program.c

42 lines
751 B
C
Raw Normal View History

2025-02-20 16:34:28 +00:00
#include <stdio.h>
2025-02-20 16:47:39 +00:00
#include <ctype.h>
2025-02-20 16:34:28 +00:00
int main() {
2025-02-20 16:47:39 +00:00
int c = 0;
int pocet_riadkov = 0;
2025-02-20 17:09:29 +00:00
int predchadzajuci = 0;
2025-02-20 16:34:28 +00:00
while (1) {
c = getchar();
if (c == EOF) {
break;
}
2025-02-20 16:47:39 +00:00
if (isalpha(c)) {
if (c >= 'a' && c <= 'z') {
c = c - 'a' + 'A';
} else if (c >= 'A' && c <= 'Z') {
c = c - 'A' + 'a';
}
} else if (c == 1425) {
2025-02-20 16:55:03 +00:00
c = 'q';
}
2025-02-20 17:09:29 +00:00
if (predchadzajuci == 'C' && c == '\'') {
2025-02-20 16:51:36 +00:00
continue;
2025-02-20 16:34:28 +00:00
}
if (c == '\n') {
pocet_riadkov++;
}
putchar(c);
2025-02-20 17:09:29 +00:00
predchadzajuci = c;
2025-02-20 16:34:28 +00:00
}
2025-02-20 16:41:24 +00:00
2025-02-20 16:43:07 +00:00
printf("\nLines count: %d\n", pocet_riadkov);
2025-02-20 16:34:28 +00:00
return 0;
}