Merge branch 'master' of git.kemt.fei.tuke.sk:mu590ku/pvjc24

This commit is contained in:
Michal Utľák 2024-02-27 14:24:29 +01:00
commit 291e3d923e

View File

@ -5,19 +5,22 @@ int main() {
int lines_count = 0; int lines_count = 0;
while ((text = getchar()) != EOF) { while ((text = getchar()) != EOF) {
if (text >= 'a' && text <= 'z') { if (text == '\n') {
text = text - 'a' + 'A'; putchar('\n');
} else if (text >= 'A' && text <= 'Z') {
text = text - 'A' + 'a';
} else if (text == '\n') {
lines_count++; lines_count++;
} else if (text < 32 || text == 127) { } else if (text == '\t') {
putchar('\t');
continue;
} else if ((text >= 'a' && text <= 'z') || (text >= 'A' && text <= 'Z')) {
putchar(text ^ ' ');
} else if ((text >= 32 && text < 127) || text == 9) {
putchar(text);
} else {
continue; continue;
} }
putchar(text);
} }
printf("\nLines count: %d\n", lines_count); printf("\nLines count: %d\n", lines_count);
return 0; return 0;
} }