-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# 답안 참고 | ||
s = list(input()) | ||
import string | ||
alphabet = list(string.ascii_lowercase) | ||
|
||
for i in alphabet: | ||
if i in s: | ||
print(s.index(i), end=' ') | ||
else: | ||
print(-1, end=' ') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
sentence = list(input().split()) | ||
print(len(sentence)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# 답안 참고 | ||
s = input().upper() | ||
setS = list(set(s)) # 중복없는 리스트 | ||
countList = [] # 글자수 리스트 | ||
|
||
for i in setS: | ||
countList.append(s.count(i)) # 중복이 있는 글자수 세서 추가 | ||
|
||
if countList.count(max(countList)) > 1: # 글자수 리스트 중 최대값이 4라고 할 때 | ||
# 해당 원소를 가지고 있는 값이 여러개이면 중복이 있다는 것이니까 ?를 반환한다. | ||
print("?") | ||
else: | ||
print(setS[countList.index(max(countList))]) # index가 위치 알려주는 메소드 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
letter = input() | ||
|
||
if letter in [0,1,2,3,4,5,6,7,8,9]: | ||
print(chr(letter)) | ||
else: | ||
print(ord(letter)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import sys | ||
|
||
n = int(input()) | ||
data = list(map(int, sys.stdin.readline().strip())) | ||
print(sum(data)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
n = 0 | ||
t = int(input()) | ||
while n<t: | ||
r, s = list(input().split()) | ||
r = int(r) | ||
s = list(s) | ||
n += 1 | ||
for i in range(len(s)): | ||
print(s[i]*r, end='') | ||
print() |