20251025 baekjoon

This commit is contained in:
songyc macbook 2025-10-25 22:02:54 +09:00
parent 68f05d2f50
commit 8bafde0fde
3 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,16 @@
#include <stdio.h>
int main() {
char str[101];
scanf("%s",str);
int idx = 0;
while(str[idx] != '\0') {
if('A' <= str[idx] && str[idx] <= 'Z') str[idx++] += 32;
else if('a' <= str[idx] && str[idx] <= 'z') str[idx++] -= 32;
}
printf("%s\n",str);
return 0;
}

View File

@ -0,0 +1,2 @@
print(''.join([(lambda c: c.upper())(c) if c.islower() else c.lower() for c in input()]))
#print(input().swapcase())

View File

@ -0,0 +1,12 @@
if let str = readLine() {
let result = str.map { c in
if c.isUppercase {
return c.lowercased()
}
else {
return c.uppercased()
}
}.joined()
print(result)
}