YavorGrancharov

BPM_Counter

Jun 5th, 2017
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.36 KB | None | 0 0
  1. using System;
  2.                    
  3. public class Program
  4. {
  5.     public static void Main()
  6.     {
  7.         int BPM = int.Parse(Console.ReadLine());
  8.         double beats = double.Parse(Console.ReadLine());
  9.        
  10.         var bars = beats / 4;
  11.         var min = beats / BPM;
  12.         var sec = (min * 60) % 60;
  13.  
  14.         Console.WriteLine(Math.Round(bars, 1) + " bars - " + Math.Floor(min) + "m " + Math.Floor(sec) + "s");
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment