pvjc24/cv1/program.c
Matus Tokarcik b8e7c066b8 cv1
2024-02-22 18:56:19 +01:00

30 lines
603 B
C

#include <stdio.h>
#include <ctype.h>
int main() {
int c;
char output;
int count_line = 0;
while ((c = getchar()) != EOF) {
if (islower(c)) {
output = toupper(c);
}
else if (isupper(c)) {
output = tolower(c);
}
else if (isgraph(c) || c == ' ') {
output = c;
}
else {
output = c;
}
putchar(output);
if (c == '\n') {
count_line++;
}
}
// printf("Number of lines: %d\n", count_line);
return 0;
}