diff --git a/a1/output/program.exe b/a1/output/program.exe deleted file mode 100644 index 1617f2c..0000000 Binary files a/a1/output/program.exe and /dev/null differ diff --git a/a1/program.c b/a1/program.c new file mode 100644 index 0000000..4c1317c --- /dev/null +++ b/a1/program.c @@ -0,0 +1,23 @@ +#include +#include + +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; +}