PROBLEM 27
Easy

Hours to Minutes

Programming Basics · C#

</>
STATUS Not solved

TASK

Problem

#27

Given a number of hours, output the equivalent number of minutes. Print only the required answer; do not print prompts, labels, or debug text.

EXAMPLE

Example

Input
4 6
Output
246

LIMITS

Constraints

- Every token parsed with `int.Parse` is a valid 32-bit signed integer; test data avoid unintended overflow in the task's intended calculation.
- Input is syntactically valid for the task except where invalid input is deliberately being tested (for example a `TryParse`/validation exercise).
- Print only the required answer; do not add prompts, labels, debug text, or extra spaces/lines.
📖
LEARN Theory for this problem
+

This is a direct arithmetic transformation. Name the input values, translate the formula exactly into C# operators, store the intermediate result when it improves readability, and print only the final value. For **Hours to Minutes**, the concrete requirement is: Given a number of hours, output the equivalent number of minutes. Keep input parsing, the core operation, and output formatting separate so each part can be checked independently.

💡
NEED HELP? Hints
+

['This is a direct arithmetic transformation. Name the input values, translate the formula exactly into C# operators, store the intermediate result when it improves readability, and print only the final value.', 'Before coding, state this exact input-to-output rule: Given a number of hours, output the equivalent number of minutes.', 'Trace the public example by hand, then test the smallest input and the edge case most likely to change an index, branch, tie, or empty result.']

ANSWER Solution
+
using System;
// Convert hours and extra minutes to total minutes.
class Program
{
    static void Main()
    {
        int[] p=Array.ConvertAll(Console.ReadLine().Split(),int.Parse);
        int a=p[0],b=p[1];
        long result=(long)a*60+b;
        Console.WriteLine(result);
    }
}