uloha1
This commit is contained in:
parent
55aede05cc
commit
69dc4e4150
@ -5,25 +5,21 @@ int main() {
|
||||
int lines_count = 0;
|
||||
|
||||
while ((c = getchar()) != EOF) {
|
||||
if (c >= 'a' && c <= 'z') {
|
||||
|
||||
if (c == '\n') {
|
||||
|
||||
lines_count++;
|
||||
} else if (c >= 'a' && c <= 'z') {
|
||||
|
||||
c = c - 'a' + 'A';
|
||||
} else if (c >= 'A' && c <= 'Z') {
|
||||
|
||||
|
||||
c = c - 'A' + 'a';
|
||||
} else if (c == '\n') {
|
||||
|
||||
lines_count++;
|
||||
}
|
||||
|
||||
if (c != '\n') {
|
||||
putchar(c);
|
||||
}
|
||||
|
||||
putchar(c);
|
||||
}
|
||||
|
||||
// Po načítaní všetkých znakov vypíš počet riadkov
|
||||
printf("\nLines Count: %d\n", lines_count);
|
||||
printf("Lines Count: %d\n", lines_count);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user