Advertisement
Guest User

Untitled

a guest
Jul 13th, 2015
453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.30 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 task1
  8. {
  9.     class task1
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             long fieldGoals = long.Parse(Console.ReadLine());
  14.             long fieldGoalsAttempts = long.Parse(Console.ReadLine());
  15.             long threePoint = long.Parse(Console.ReadLine());
  16.             long turnovers = long.Parse(Console.ReadLine());
  17.  
  18.             long offensiveRebunds = long.Parse(Console.ReadLine());
  19.             long defensiveRebounds = long.Parse(Console.ReadLine());
  20.             long freeThrows = long.Parse(Console.ReadLine());
  21.             long freeThrowAttempts = long.Parse(Console.ReadLine());
  22.  
  23.             decimal eFG = (fieldGoals + 0.5m * threePoint) / (decimal)fieldGoalsAttempts;
  24.             decimal tOV = turnovers / (fieldGoalsAttempts + 0.44m * freeThrowAttempts + turnovers);
  25.             decimal oRB = (decimal)offensiveRebunds / (offensiveRebunds + defensiveRebounds);
  26.             decimal fT = (decimal)freeThrows / fieldGoalsAttempts;
  27.  
  28.             Console.WriteLine("eFG% {0:F3}", eFG);
  29.             Console.WriteLine("TOV% {0:F3}", tOV);
  30.             Console.WriteLine("ORB% {0:F3}", oRB);
  31.             Console.WriteLine("FT% {0:F3}", fT);
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement