33 lines
560 B
C
33 lines
560 B
C
#include <stdio.h>
|
|
#include <ctype.h>
|
|
|
|
void CapsLock() {
|
|
|
|
int x;
|
|
int numlines = 0;
|
|
|
|
while ((x = getchar()) != EOF) {
|
|
|
|
if (x == '\n') {
|
|
putchar('\n');
|
|
numlines++;
|
|
}
|
|
else if (islower(x)) {
|
|
putchar(toupper(x));
|
|
}
|
|
else if (isupper(x)) {
|
|
putchar(tolower(x));
|
|
}
|
|
else if (isprint(x) || x == '\t') {
|
|
putchar(x);
|
|
}
|
|
}
|
|
|
|
printf("\nLines count: %d\n", numlines);
|
|
}
|
|
|
|
int main() {
|
|
CapsLock();
|
|
return 0;
|
|
}
|