This commit is contained in:
Džubara 2024-02-25 21:23:20 +01:00
parent aa2877397f
commit 2a8f1f3baf

View File

@ -1,25 +1,29 @@
#include <stdio.h>
#include <ctype.h>
int main() {
int line_count = 0;
char input_char;
int c;
int lineCount = 0;
while ((input_char = getchar()) != EOF) {
if (input_char == '\n') {
line_count++;
while ((c = getchar()) != EOF) {
if (c >= 'a' && c <= 'z') {
c = c - 'a' + 'A';
} else if (c >= 'A' && c <= 'Z') {
c = c - 'A' + 'a';
}
if (islower(input_char)) {
input_char = toupper(input_char);
} else if (isupper(input_char)) {
input_char = tolower(input_char);
if (c == '\n') {
lineCount++;
}
putchar(input_char);
putchar(c);
}
printf("\nLines␣count:%d\n", line_count);
printf("\nPočet načítaných riadkov: %d\n", lineCount);
return 0;
}