33 lines
592 B
C
33 lines
592 B
C
#include<stdio.h>
|
|
#include<stdlib.h>
|
|
|
|
void printCharacter(int c);
|
|
|
|
int main() {
|
|
int lineCount = 0;
|
|
int c;
|
|
char outChar;
|
|
|
|
while((c = getchar()) != EOF) {
|
|
if (c >= 'a' && c <= 'z') {
|
|
outChar = c - 'a' + 'A';
|
|
} else if (c >= 'A' && c <= 'Z') {
|
|
outChar = c - 'A' + 'a';
|
|
} else {
|
|
if (c == '\n') {
|
|
lineCount++;
|
|
}
|
|
|
|
outChar = c;
|
|
}
|
|
|
|
printCharacter(outChar);
|
|
}
|
|
|
|
printf("\nPočet riadkov: %d\n", lineCount);
|
|
}
|
|
|
|
void printCharacter(int c) {
|
|
printf("%c", c);
|
|
}
|