21.2
This commit is contained in:
parent
0bdd5c0058
commit
f95070d410
24
cv1/program.c
Normal file
24
cv1/program.c
Normal file
@ -0,0 +1,24 @@
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
int main() {
|
||||
int lines_count = -1;
|
||||
int c;
|
||||
|
||||
while ((c = getchar()) != EOF) {
|
||||
if (islower(c)) {
|
||||
putchar(toupper(c));
|
||||
} else if (isupper(c)) {
|
||||
putchar(tolower(c));
|
||||
} else {
|
||||
putchar(c);
|
||||
if (c == '\n') {
|
||||
lines_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
printf("Počet načítaných riadkov: %d\n", lines_count);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user