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:21:04 +00:00
|
|
|
else if (c == '\t'){
|
2024-02-21 17:23:41 +00:00
|
|
|
//putchar(c);
|
|
|
|
continue;
|
2024-02-21 17:21:04 +00:00
|
|
|
}
|
|
|
|
else if (c < ' ' || c >= 127) {
|
2024-02-21 16:46:19 +00:00
|
|
|
continue; // Preskočiť značky
|
|
|
|
}
|
2024-02-21 17:14:40 +00:00
|
|
|
|
2024-02-21 16:46:19 +00:00
|
|
|
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;
|
|
|
|
}
|