kirililchev3

BPM - math floor, math round

May 27th, 2018
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. using System;
  2.  
  3. namespace P04_BPMcounter
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int bpm = int.Parse(Console.ReadLine());
  10.             int numOfBeats = int.Parse(Console.ReadLine());
  11.             double seconds = numOfBeats * 60.0 / bpm;
  12.             int minutes = (int)seconds / 60;
  13.             seconds -= minutes * 60;
  14.             Console.WriteLine($"{Math.Round(numOfBeats / 4.0, 1) } bars - { minutes}m {Math.Floor(seconds)}s");
  15.  
  16.  
  17.  
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment