dostali sme
This commit is contained in:
commit
086edc9fe2
31
a1/program.c
Normal file
31
a1/program.c
Normal file
@ -0,0 +1,31 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int c;
|
||||
int riadky = 0;
|
||||
|
||||
while ((c = getchar()) != EOF) {
|
||||
if (c == '\n') {
|
||||
putchar('\n');
|
||||
riadky++;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (c < 32 || c == 127) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (c >= 'a' && c <= 'z') {
|
||||
putchar(c - 'a' + 'A');
|
||||
} else if (c >= 'A' && c <= 'Z') {
|
||||
putchar(c - 'A' + 'a');
|
||||
} else {
|
||||
|
||||
putchar(c);
|
||||
}
|
||||
}
|
||||
|
||||
printf("\nPocet riadkov: %d\n", riadky);
|
||||
return 0;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user