This commit is contained in:
Rudolf Zambory 2025-02-20 17:34:28 +01:00
parent 306176049b
commit c69fd51a19

30
a1/program.c Normal file
View File

@ -0,0 +1,30 @@
#include <stdio.h>
int main() {
int c = 0;
int pocet_riadkov = 0;
while (1) {
c = getchar();
if (c == EOF) {
break;
}
if (c >= 'a' && c <= 'z') {
c = c - 'a' + 'A';
} else if (c >= 'A' && c <= 'Z') {
c = c - 'A' + 'a';
}
if (c == '\n') {
pocet_riadkov++;
}
// vypis znaku
putchar(c);
}
printf("\nPočet riadkov: %d\n", pocet_riadkov);
return 0;
}