gfs
This commit is contained in:
parent
306176049b
commit
c69fd51a19
30
a1/program.c
Normal file
30
a1/program.c
Normal file
@ -0,0 +1,30 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int c = 0;
|
||||
int pocet_riadkov = 0;
|
||||
|
||||
while (1) {
|
||||
c = getchar();
|
||||
|
||||
if (c == EOF) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (c >= 'a' && c <= 'z') {
|
||||
c = c - 'a' + 'A';
|
||||
} else if (c >= 'A' && c <= 'Z') {
|
||||
c = c - 'A' + 'a';
|
||||
}
|
||||
|
||||
if (c == '\n') {
|
||||
pocet_riadkov++;
|
||||
}
|
||||
|
||||
// vypis znaku
|
||||
putchar(c);
|
||||
}
|
||||
printf("\nPočet riadkov: %d\n", pocet_riadkov);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user