목록전체보기 (378)
코딩로그

[문제] 그가 「진짜」이면 gosu, 「가짜」이면 hasu를 출력한다. [입력] $K/D/A$가 주어진다. [출력] 그가 「진짜」이면 gosu, 「가짜」이면 hasu를 출력한다. [제한] $0 \le K, D, A \le 20$ [Source Code] #include #include #include #include #include using namespace std; int main() { int k = 0, d = 0, a = 0; char temp; cin >> k >> temp >> d >> temp >> a; if(k + a < d || d == 0) cout
[문제] A solid competitive programming team can rack up a lot of prize money. Knowing how strong your team is, you are certain to win a lot of contests, so you had better sit down now and check that everybody will receive the same fair distribution of winnings. You will participate in multiple contests, and at the end of each one receive a set amount of prize money. You can distribute any amount t..

[문제] 당신은 싸이컴을 향해 절을 하려고 합니다. 하지만, 당신이 싸이컴에 들어오고 싶어서 절을 한 번 할 수도 있고, 싸이컴을 매우 싫어해 절을 두 번 할 수도 있습니다. 당신이 절을 할 횟수가 주어질 때, 그 횟수만큼 절하는 프로그램을 작성하세요. 실제로 프로그램을 이용해 절을 할 수는 없기 때문에, 대신 “SciComLove”를 출력하도록 합니다. [입력] 첫 줄에 정수 $N$이 주어집니다. [출력] "SciComLove"를 예제와 같이 $N$번 출력합니다. 단, 따옴표는 출력하지 않습니다. [제한] $1 \le N \le 2$ [Source Code] #include #include #include #include #include using namespace std; int main() { in..

[문제] At sea level, atmospheric pressure is 100 kPa and water begins to boil at 100◦C. As you go above sea level, atmospheric pressure decreases, and water boils at lower temperatures. As you go below sea level, atmospheric pressure increases, and water boils at higher temperatures. A formula relating atmospheric pressure to the temperature at which water begins to boil is P = 5 × B − 400 where P..

[문제] In many introductory computer programming classes, the first program that students learn to write just prints “Hello, world!” It is used as a first assignment because it is a simple program that produces output. The program dates back to at least 1974, when Brian Kernighan used it as an example in a C programming tutorial. Its popularity has grown since then. Louisiana Tech University's ACM..

[문제] Barley the dog loves treats. At the end of the day he is either happy or sad depending on the number and size of treats he receives throughout the day. The treats come in three sizes: small, medium, and large. His happiness score can be measured using the following formula: 1 × S + 2 × M + 3 × L where S is the number of small treats, M is the number of medium treats and L is the number of l..

[문제] You record all of the scoring activity at a basketball game. Points are scored by a 3-point shot, a 2-point field goal, or a 1-point free throw. You know the number of each of these types of scoring for the two teams: the Apples and the Bananas. Your job is to determine which team won, or if the game ended in a tie. [입력] The first three lines of input describe the scoring of the Apples, and..

[문제] 4 × 3 = 12이다. 이 식을 통해 다음과 같은 사실을 알 수 있다. 3은 12의 약수이고, 12는 3의 배수이다. 4도 12의 약수이고, 12는 4의 배수이다. 두 수가 주어졌을 때, 다음 3가지 중 어떤 관계인지 구하는 프로그램을 작성하시오. 첫 번째 숫자가 두 번째 숫자의 약수이다. 첫 번째 숫자가 두 번째 숫자의 배수이다. 첫 번째 숫자가 두 번째 숫자의 약수와 배수 모두 아니다. [입력] 입력은 여러 테스트 케이스로 이루어져 있다. 각 테스트 케이스는 10,000이 넘지않는 두 자연수로 이루어져 있다. 마지막 줄에는 0이 2개 주어진다. 두 수가 같은 경우는 없다. [출력] 각 테스트 케이스마다 첫 번째 숫자가 두 번째 숫자의 약수라면 factor를, 배수라면 multiple을, 둘..