Advertisement
Guest User

Untitled

a guest
May 25th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. using System;
  2. using System.Numerics;
  3. namespace SnowBalls
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int n = int.Parse(Console.ReadLine());
  10. BigInteger highestSnowballValue ;
  11. BigInteger currentSnowBallValue ;
  12. int highestSnowBallSnow = 0;
  13. int highestSnowBallTime = 0;
  14. int highestSnowBallQuality = 0;
  15. for (int i = 0; i < n; i++)
  16. {
  17. int snowballSnow = int.Parse(Console.ReadLine());
  18. int snowballTime = int.Parse(Console.ReadLine());
  19. int snowballQuality = int.Parse(Console.ReadLine());
  20.  
  21.  
  22. if (snowballQuality == 0)
  23. {
  24. currentSnowBallValue = snowballSnow / snowballTime;
  25. }
  26. else
  27. {
  28. currentSnowBallValue = snowballSnow / snowballTime;
  29. BigInteger gradationNumber = currentSnowBallValue;
  30. for (int j = 1; j < snowballQuality; j++)
  31. {
  32. currentSnowBallValue *= gradationNumber;
  33. }
  34. }
  35.  
  36. if(currentSnowBallValue > highestSnowballValue)
  37. {
  38. highestSnowballValue = currentSnowBallValue;
  39. highestSnowBallSnow = snowballSnow;
  40. highestSnowBallTime = snowballTime;
  41. highestSnowBallQuality = snowballQuality;
  42. }
  43.  
  44. }
  45.  
  46. Console.WriteLine($"{highestSnowBallSnow} : {highestSnowBallTime} = {highestSnowballValue} ({highestSnowBallQuality})");
  47. }
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement