목록알고리즘 (185)
규도자 개발 블로그
Objective In this challenge, we're going to use loops to help us do some simple math. Check out the Tutorial tab to learn more.Task Given an integer, , print its first multiples. Each multiple (where ) should be printed on a new line in the form: n x i = result.Input FormatA single integer, .ConstraintsOutput FormatPrint lines of output; each line (where ) contains the of in the form: n x i = re..
Objective In this challenge, we're going to learn about the difference between a class and an instance; because this is an Object Orientedconcept, it's only enabled in certain languages. Check out the Tutorial tab for learning materials and an instructional video!Task Write a Person class with an instance variable, , and a constructor that takes an integer, , as a parameter. The constructor must..
Objective In this challenge, we're getting started with conditional statements. Check out the Tutorial tab for learning materials and an instructional video!Task Given an integer, , perform the following conditional actions:If is odd, print WeirdIf is even and in the inclusive range of to , print Not WeirdIf is even and in the inclusive range of to , print WeirdIf is even and greater than , prin..
Objective In this challenge, you'll work with arithmetic operators. Check out the Tutorial tab for learning materials and an instructional video! Task Given the meal price (base cost of a meal), tip percent (the percentage of the meal price being added as tip), and tax percent(the percentage of the meal price being added as tax) for a meal, find and print the meal's total cost. Note: Be sure to ..
Objective Today, we're discussing data types. Check out the Tutorial tab for learning materials and an instructional video! Task Complete the code in the editor below. The variables , , and are already declared and initialized for you. You must:Declare variables: one of type int, one of type double, and one of type String.Read lines of input from stdin (according to the sequence given in the Inp..
Objective In this challenge, we review some basic concepts that will get you started with this series. You will need to use the same (or similar) syntax to read input and write output in challenges throughout HackerRank. Check out the Tutorial tab for learning materials and an instructional video! Task To complete this challenge, you must save a line of input from stdin to a variable, print Hell..
HackerLand University has the following grading policy:Every student receives a in the inclusive range from to .Any less than is a failing grade.Sam is a professor at the university and likes to round each student's according to these rules:If the difference between the and the next multiple of is less than , round up to the next multiple of .If the value of is less than , no rounding occurs as ..
Sam's house has an apple tree and an orange tree that yield an abundance of fruit. In the diagram below, the red region denotes his house, where is the start point, and is the endpoint. The apple tree is to the left of his house, and the orange tree is to its right. You can assume the trees are located on a single point, where the apple tree is at point , and the orange tree is at point .When a ..
[백준/10950/파이썬] A+B - 3 문제 두 정수 A와 B를 입력받은 다음, A+B를 출력하는 프로그램을 작성하시오. 입력 첫째 줄에 테스트 케이스의 개수 T가 주어진다.각 테스트 케이스는 한 줄로 이루어져 있으며, 각 줄에 A와 B가 주어진다. (0 < A, B < 10) 출력 각 테스트 케이스마다 A+B를 출력한다. 입출력 예 입력출력 5 1 1 2 3 3 4 9 8 5 22 5 7 17 7 풀이 count = int(input()) result_list = [] for i in range(count): number_input = input().split() number_input = map(int, number_input) result_list.append(sum(number_input)) f..
You are in charge of the cake for your niece's birthday and have decided the cake will have one candle for each year of her total age. When she blows out the candles, she’ll only be able to blow out the tallest ones. Your task is to find out how many candles she can successfully blow out.For example, if your niece is turning years old, and the cake will have candles of height , , , , she will be..