Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace CreditSystem
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int totalMinutes = 0;
- double totalDistance = 0;
- int totalCalories = 0;
- for (int i = 0; i < n; i++)
- {
- int dayMinutes = int.Parse(Console.ReadLine());
- double dayDistance = double.Parse(Console.ReadLine());
- string distanceUnit = Console.ReadLine();
- if (distanceUnit == "m")
- dayDistance *= 0.001;
- totalMinutes += dayMinutes;
- totalDistance += dayDistance;
- totalCalories += dayMinutes * 400 / 20;
- }
- Console.WriteLine($"He ran {totalDistance:f2}km for {totalMinutes} minutes and burned {totalCalories} calories.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement