Advertisement
YORDAN2347

11. Snowballs

Jan 24th, 2021
556
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.15 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _11._SnowBalls
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int snowBalls = int.Parse(Console.ReadLine());
  10.             int bestSnowballValue = 0;
  11.             int[] bestQualities = new int[3];
  12.  
  13.             for (int i = 0; i < snowBalls; i++)
  14.             {
  15.                 int[] snowballsQualities = new int[3];
  16.                 //({snowballSnow}, {snowballTime}, {snowBallQuality})
  17.  
  18.                 for (int j = 0; j < snowballsQualities.Length; j++)
  19.                 {
  20.                     snowballsQualities[j] = int.Parse(Console.ReadLine());
  21.                 }
  22.  
  23.                 int snowballValue = (int)Math.Pow(
  24.                     (snowballsQualities[0] / snowballsQualities[1]),
  25.                     snowballsQualities[2]);
  26.  
  27.                 if (snowballValue > bestSnowballValue)
  28.                 {
  29.                     bestQualities = snowballsQualities;
  30.                     bestSnowballValue = snowballValue;
  31.                 }
  32.             }
  33.             Console.WriteLine($"{bestQualities[0]} : {bestQualities[1]} = {bestSnowballValue} ({bestQualities[2]})");
  34.         }
  35.     }
  36. }
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement