2024-02-21 16:46:19 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
int main(){
|
|
|
|
int c;
|
|
|
|
int line_count = 0;
|
|
|
|
|
|
|
|
while ((c = getchar()) != EOF){
|
|
|
|
if (c >= 'a' && c <= 'z') {
|
|
|
|
c = c - 'a' + 'A'; // Zmena malého písmena na veľké
|
|
|
|
}
|
|
|
|
else if (c >= 'A' && c <= 'Z') {
|
|
|
|
c = c - 'A' + 'a'; // Zmena veľkého písmena na malé
|
|
|
|
}
|
|
|
|
else if (c == '\n') {
|
|
|
|
line_count++; // Zvýšte počítadlo riadkov na konce riadka
|
|
|
|
}
|
2024-02-21 17:06:48 +00:00
|
|
|
else if (c <= ' ' || c > '~') {
|
2024-02-21 16:46:19 +00:00
|
|
|
continue; // Preskočiť značky
|
|
|
|
}
|
|
|
|
putchar(c); // Vypíš znak
|
|
|
|
}
|
2024-02-21 17:02:49 +00:00
|
|
|
printf("\nLines count: %d\n", line_count);
|
2024-02-21 16:46:19 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|