This commit is contained in:
Igor Dzuro 2020-03-06 00:36:05 +01:00
parent b727c31ab1
commit 12c46d33f8

32
du1/program.c Normal file
View File

@ -0,0 +1,32 @@
#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);
}