pump it
This commit is contained in:
parent
b727c31ab1
commit
12c46d33f8
32
du1/program.c
Normal file
32
du1/program.c
Normal 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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user