본문 바로가기

코딩테스트10

[LV0] 나이 출력 *문제 설명* 머쓱이는 40살인 선생님이 몇 년도에 태어났는지 궁금해졌습니다. 나이 age가 주어질 때, 2022년을 기준 출생 연도를 return 하는 solution 함수를 완성해주세요. 더보기 def solution(age): answer = 2022-age+1 return answer 2022. 10. 5.
[LV0]두 수의 합 *문제 설명* 정수 num1과 num2가 주어질 때, num1과 num2의 합을 return하도록 soltuion 함수를 완성해주세요. 더보기 def solution(num1, num2): answer = num1+num2 return answer 2022. 10. 5.
[easy] Python if-Else (with Python) *Task* Given an integer, N, perform the following conditional actions: If N is odd, print Weird If N is even and in the inclusive range of 2 to 5 , print Not Weird If N is even and in the inclusive range of 6 to 20, print Weird If N is even and greater than 20, print Not Weird *Input Format* A single line containing a positive integer, N *Output Format* 더보기 #!/bin/python3 import math import os i.. 2022. 9. 30.
[easy] The World of Numbers(with shell) *problem* Given two integers, and , find their sum, difference, product, and quotient. *Input Format* Two lines containing one integer each ( and , respectively). *Output Format* Four lines containing the sum (), difference (), product (), and quotient (), respectively. (While computing the quotient, print only the integer part.) *Answer* 더보기 read x; read y; echo "$((x+y))"; echo "$((x-y))"; ech.. 2022. 9. 29.
[easy]Looping with Numbers(with shell) *problem* Use a for loop to display the natural numbers from to . *Input Format* There is no input *Output Format* *Answer" 더보기 2022. 9. 29.
[easy]A personalized Echo (with shell) *Problem* Write a Bash script which accepts as input and displays the greeting "Welcome (name)" *Input Format* There is one line of text, . *Output Format* One line: "Welcome (name)" (quotation marks excluded). The evaluation will be case-sensitive. *Answer* 더보기 - read는 표준 입력(파이프라인 입력 또는 키보드 입력)에서 한 줄의 내용씩 읽어 들이는 명령어 2022. 9. 29.