refresh
This commit is contained in:
parent
480138a199
commit
4164b2e021
Binary file not shown.
23
a1/program.c
Normal file
23
a1/program.c
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
void funkcia (int c, int *line_count) {
|
||||||
|
if (c == '\n') {
|
||||||
|
(*line_count)++;
|
||||||
|
putchar(c);
|
||||||
|
} else if (isalpha(c)) {
|
||||||
|
putchar(islower(c) ? toupper(c) : tolower(c));
|
||||||
|
} else if (isprint(c)) {
|
||||||
|
putchar(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int c;
|
||||||
|
int c2 = 0;
|
||||||
|
while ((c = getchar()) !=EOF) {
|
||||||
|
funkcia(c, &c2);
|
||||||
|
}
|
||||||
|
printf("\nHow many strings: %d\n", c2);
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user