capslock
This commit is contained in:
parent
0ec8b25220
commit
bb23434095
BIN
a1/.program.c.swp → a1/capslock
Normal file → Executable file
BIN
a1/.program.c.swp → a1/capslock
Normal file → Executable file
Binary file not shown.
23
a1/capslock.c
Normal file
23
a1/capslock.c
Normal file
@ -0,0 +1,23 @@
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
int main() {
|
||||
int c;
|
||||
int lines = 0;
|
||||
|
||||
while ((c = getchar()) != EOF) {
|
||||
if (islower(c)) {
|
||||
putchar(toupper(c));
|
||||
} else if (isupper(c)) {
|
||||
putchar(tolower(c));
|
||||
} else if (c == '\n') {
|
||||
putchar(c);
|
||||
lines++;
|
||||
} else if (isprint(c)) {
|
||||
putchar(c);
|
||||
}
|
||||
}
|
||||
|
||||
printf("\nRiadky: %d\n", lines);
|
||||
return 0;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user