46 lines
805 B
C
46 lines
805 B
C
#include <stdio.h>
|
|
#include <ctype.h>
|
|
|
|
void CapsLock() {
|
|
|
|
int x;
|
|
int numlines = 0;
|
|
int check = 0;
|
|
|
|
while ((x = getchar()) != EOF) {
|
|
|
|
if (x == '\n') {
|
|
putchar('\n');
|
|
numlines++;
|
|
}
|
|
else if (islower(x)) {
|
|
putchar(x - 'a' + 'A');
|
|
check = 1;
|
|
}
|
|
|
|
else if (isupper(x)) {
|
|
putchar(x - 'A' + 'a');
|
|
check = 1;
|
|
}
|
|
else if (x >= 32 && x <= 126) {
|
|
putchar(x);
|
|
}
|
|
}
|
|
|
|
printf("Lines count: %d\n", numlines);
|
|
|
|
if (check) {
|
|
printf("Vo vstupe sa nachadzalo aspon jedno pismeno.\n");
|
|
} else {
|
|
printf("Vo vstupe sa nenachadzalo ziadne pismeno.\n");
|
|
}
|
|
}
|
|
|
|
int main() {
|
|
|
|
CapsLock();
|
|
|
|
return 0;
|
|
|
|
}
|