fix
This commit is contained in:
parent
2d7275b598
commit
c5aa6866c5
29
a1/program.c
29
a1/program.c
@ -1,7 +1,30 @@
|
|||||||
// Definícia funkcií ktoré budete používať
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
// Tu môžte dopísať Vaše funkcie
|
#include <stdlib.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
// Tu píšete program
|
int o;
|
||||||
|
int riadok = 0;
|
||||||
|
|
||||||
|
while ((o = getchar()) != EOF) {
|
||||||
|
if (o >= 'a' && o <= 'z') {
|
||||||
|
putchar(o - 32);
|
||||||
|
}
|
||||||
|
else if (o == '\n') {
|
||||||
|
putchar(o);
|
||||||
|
riadok = riadok + 1;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (o >= 'A' && o <= 'Z') {
|
||||||
|
putchar(o + 32);
|
||||||
|
}
|
||||||
|
else if (isprint(o)) {
|
||||||
|
putchar(o);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("\nLines_count: %d\n", riadok);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user