20251025 baekjoon
This commit is contained in:
parent
68f05d2f50
commit
8bafde0fde
16
code_study/Baekjoon/c/2744.c
Normal file
16
code_study/Baekjoon/c/2744.c
Normal 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;
|
||||||
|
}
|
||||||
2
code_study/Baekjoon/python/2744.py
Normal file
2
code_study/Baekjoon/python/2744.py
Normal 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())
|
||||||
12
code_study/Baekjoon/swift/2744.swift
Normal file
12
code_study/Baekjoon/swift/2744.swift
Normal 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)
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user