Category «Integer and float numbers»

Clock face – 2

Clock face – 2. Hour hand turned by α degrees since the midnight. Determine the angle by which minute hand turned since the start of the current hour. Input and output in this problems are floating-point numbers. Input Output 190 120 0 0 5 60 10 120 15 180  

Clock face – 1

Clock face – 1. H hours, M minutes and S seconds are passed since the midnight (0 ≤ H < 12, 0 ≤ M < 60, 0 ≤ S < 60). Determine the angle (in degrees) of the hour hand on the clock face right now. Input Output 1 2 6 31.05 1 0 0 …

Snail

Snail. A snail goes up A feet during the day and falls B feet at night. How long does it take him to go up H feet? Given three integer numbers H, A and B (A > B), the program should output a number of days. Input Output 10 3 2 8 20 7 3 …

Total cost

Total cost. A cupcake costs A dollars and B cents. Determine, how many dollars and cents should one pay for N cupcakes. A program gets three numbers: A, B, N. It should print two numbers: total cost in dollars and cents. Input Output 2 50 4 10 0 10 15 2 20 30 3000 99 …

Digital clock

Digital clock. Given the integer N – the number of minutes that is passed since midnight – how many hours and minutes are displayed on the 24h digital clock? The program should print two numbers: the number of hours (between 0 and 23) and the number of minutes (between 0 and 59). For example, if …

Day of week

Day of week. Let’s count the days of the week as follows: 0 – Sunday, 1 – Monday, 2 – Tuesday, …, 6 – Saturday. Given an integer K in the range 1 to 365, find the number of the day of the week for the K-th day of the year provided that this year’s …

Car route

Car route. A car can cover distance of N kilometers per day. How many days will it take to cover a route of length M kilometers? The program gets two numbers: N and M. Input Output 700 750 2 700 2100 3 10 15 2 10 16 2 10 19 2 10 70 7 10 …