목록c++ (345)
코딩로그

[문제] Like many families with small children, my family’s refrigerator is adorned with a set of alphabet magnets: 26 separate magnets, each containing one letter of the alphabet. These magnets can be rearranged to create words and phrases. I feel it is my parental duty to use these magnets to create messages that are witty and insightful, yet at the same time caring and supportive. Unfortunately,..

[문제] Pirates talk a funny way. They say word where the letters are repeated more than they need to be. We would like know which letter appears the most frequently in a Pirate word. For example: In the word “arrrrrghh”, the letter “r” appears 5 times while “h” appears twice. Write a program that reads a pirate word from the terminal and writes the letter that occurs most frequently. It is guarant..

[문제] In the book All Creatures of Mythology, gnomes are kind, bearded creatures, while goblins tend to be bossy and simple-minded. The goblins like to harass the gnomes by making them line up in groups of three, ordered by the length of their beards. The gnomes, being of different physical heights, vary their arrangements to confuse the goblins. Therefore, the goblins must actually measure the b..

[문제] The Bloggs family keep getting invited to birthday parties, and they feel they must buy the person who invites them a present. The trouble is they do not have much money! The family has come up with a strategy. Whenever they go to a shop to buy a present, they will not buy the cheapest present (that would seem mean!), so they buy the second cheapest gift they can find. Your task here is to ..

[문제] Back in the old days before the creation of the mighty Centauri Republic, the planet Centauri Prime was split into several independent kingdoms. The kingdom of Mollaristan was ruled by king Loatold, while the kingdom of Auritania was under the rule of queen Elana. In fact, it just so happened that every kingdom whose name ended in a consonant was ruled by a king, while every kingdom whose n..

[문제] Rock, Paper, Scissors is a classic hand game for two people. Each participant holds out either a fist (rock), open hand (paper), or two-finger V (scissors). If both players show the same gesture, they try again. They continue until there are two different gestures. The winner is then determined according to the table below: Rock beats Scissors Paper beats Rock Scissors beats Paper Your task..

[문제] A cuboid is a 3 dimensional shape in which each of the six faces is a rectangle. Sally Jones, a primary school teacher, is giving her pupils some practice at calculating the volume of a cuboid. I am sure you remember that volume = length x width x height. Sally has given her pupils a table of lengths, widths, heights and volumes. Each row on the table has one of the 4 values missing; the pu..

[문제] John and Mary have been friends since nursery school. Since then, they have shared a playful routine: every time they meet, they play Head or Tail with a coin, and whoever wins has the privilege of deciding what they are going to play during the day. Mary always choose Head, and John always choose Tail. Nowadays they are in college, but continue being truly good friends. Whenever they meet,..