pvjc24/cv1/program.c

12 lines
228 B
C
Raw Normal View History

2024-02-23 13:00:03 +00:00
#include <stdio.h>
2024-02-23 12:58:04 +00:00
char simulate_caps_lock(char c) {
if ('a' <= c && c <= 'z') {
return c - ('a' - 'A');
} else if ('A' <= c && c <= 'Z') {
return c + ('a' - 'A');
} else {
return c;
}
}