Club|Project/Ec.crew 코딩 스터디
Ec.crew 2회차 정기 모임 문제
정람지
2022. 7. 26. 22:27
1회차는 OT
스터디 모집글!
나경 <의좋은 형제-구룸>
jinMoney = int(input("첫날 진우의 돈:"))
sonMoney = int(input("첫날 선우의 돈:"))
WhenTime = int(input("몇 번째까지?:"))
if WhenTime >= 2:
if WhenTime%2==1:
for i in range(int((WhenTime-1)/2)):
sonMoney += round(jinMoney/2,1)
jinMoney -= round(jinMoney/2,1)
jinMoney += round(sonMoney/2,1)
sonMoney -= round(sonMoney/2,1)
sonMoney += round(jinMoney/2,1)
jinMoney -= round(jinMoney/2,1)
else:
for i in range(int(WhenTime/2)):
sonMoney += round(jinMoney/2,1)
jinMoney -= round(jinMoney/2,1)
jinMoney += round(sonMoney/2,1)
sonMoney -= round(sonMoney/2,1)
else:
sonMoney += round(jinMoney/2,1)
jinMoney -= round(jinMoney/2,1)
print(int(jinMoney),int(sonMoney))
round() 반올림
수연 <숨은 메세지 찾기>
c언어에 맞추어진 문제여서 숫자를 조금 고쳐야 함. 약간의 창의력이 필요한 재미있는 문제.
Letter = "i h i d t h e p a s s w o r d i n t h i s n o t e p u t t h c e t e x t i n a l p h a b e t i c a l o r d e r a n d l o o k f o r t h e p a s s w o r d"
LetterSplit = Letter.split()
LetterSplit.sort()
print(LetterSplit[14],LetterSplit[61],LetterSplit[8],LetterSplit[2],LetterSplit[49],LetterSplit[17])
이건 띄어쓰기 치트키를 써서
Letter = "ihidthepasswordinthisnoteputthetextinalphabeticalorderandlookforthepassword"
LetterSplit = list(Letter)
LetterSplit.sort()
print(LetterSplit[14],LetterSplit[61],LetterSplit[7],LetterSplit[2],LetterSplit[49],LetterSplit[17])
띄어쓰기 없이 보완
파이썬은 sort()가 있어서.. c언어는 그런 게 없어서 직접 만들더라 공부하기에는 c언어가 좋을 듯
정화언니 <크리스마스 트리 / 피라미드 출력하기 - 구름>
+
높이는 사용자에게 입력받기
홀수면 출력하고 짝수면 홀수로 입력해달라고 하기
userNumber = int(input("몇층트리?:"))
if userNumber%2 == 1:
print("짝수 출력하래:")
else:
for i in range(userNumber):
for j in range(int(userNumber-i)):
print(" ",end="")
for j in range(i*2-1):
print("*",end="")
print("")
이중 포문이라서 생각해야 한다~ 삼중 포문도 해보고 싶다~ 머리가 좋았으면 좋겠다~
은채 < 거울상문자 - 백준>
구조도 그리는 법을 배우고 그려봤다
첫 구조도 그려봤다.
점점 모양이랑 다 지켜서 하진 않게 되는 것 같다 그냥 네모랑 마름모 화상표만으로 그려도 정리되는 듯
reflect = ['b', 'd', 'p', 'q', 'i', 'o', 'v', 'w', 'x']
while True:
word = input()
if word == '#':
break
result = ''
for alphabet in word:
if alphabet not in reflect:
result = "INVALID"
break
else:
if alphabet == 'b':
result += 'd'
elif alphabet == 'd':
result += 'b'
elif alphabet == 'p':
result += 'q'
elif alphabet == 'q':
result += 'p'
else:
result += alphabet
if result != 'INVALID':
# 값을 역순으로 출력!
print(result[::-1])
else:
print(result)
사실 어려워서 블로그들 참고했따. 값 거울상문자로 바꾸고 나서 순서도 다 거꾸로 바꿔야 한다는 걸 몰랐다. 생각을 잘 하자.

끝