Advertisement
ivanov_ivan

FourFactors

Oct 31st, 2015
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.45 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Four_Factors
  8.     {
  9.     class FourFactors
  10.         {
  11.         static void Main()
  12.             {
  13.             //input
  14.             double FG = double.Parse(Console.ReadLine());
  15.             double FGA = double.Parse(Console.ReadLine());
  16.             double ThreeP = double.Parse(Console.ReadLine());
  17.             double TOV = double.Parse(Console.ReadLine());
  18.             double ORB = double.Parse(Console.ReadLine());
  19.             double OppDRB = double.Parse(Console.ReadLine());
  20.             double FT = double.Parse(Console.ReadLine());
  21.             double FTA = double.Parse(Console.ReadLine());
  22.             // Calculation
  23.             double eFGPer = (FG + (0.5 * ThreeP)) / FGA;
  24.             double TOVPer = (TOV / (FGA + (0.44 * FTA) + TOV));
  25.             double ORBPer = ORB / (ORB + OppDRB);
  26.             double FTPer = FT / FGA;
  27.             // output
  28.             if (eFGPer >= 0 || TOVPer >= 0 || ORBPer >= 0 || FTPer >= 0)
  29.                 {
  30.                 Console.WriteLine("eFG% {0:F3}", eFGPer);
  31.                 Console.WriteLine("TOV% {0:F3}", TOVPer);
  32.                 Console.WriteLine("ORB% {0:F3}", ORBPer);
  33.                 Console.WriteLine("FT% {0:F3}", FTPer);
  34.                 }
  35.             else
  36.                 {
  37.                 Console.WriteLine();
  38.                 }
  39.            
  40.             }
  41.         }
  42.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement