Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace MakeItRain
- {
- class Program
- {
- static void Main(string[] args)
- {
- int N = int.Parse(Console.ReadLine());
- List<int[]> AllTriplets = GetTriplets(N);
- int TCounter = 0;
- int FCounter = 0;
- int ASCII_T = 84;
- int ASCII_F = 70;
- foreach (int[] Triplet in AllTriplets)
- {
- if (Triplet[1] != 0)
- {
- if (Triplet[0] / Triplet[1] == Triplet[2])
- {
- TCounter += ASCII_T;
- FCounter /= (ASCII_T / 10);
- }
- else
- {
- FCounter += ASCII_F;
- TCounter /= (ASCII_F / 10);
- }
- }
- else if (Triplet[1] == 0)
- {
- FCounter += ASCII_F;
- TCounter /= (ASCII_F / 10);
- }
- }
- bool rain = false;
- if (FCounter == 0)
- {
- rain = false;
- }
- else
- {
- int Divition = TCounter / FCounter;
- if (Divition % 2 == 0)
- {
- rain = true;
- }
- }
- Console.WriteLine($"T: {TCounter}");
- Console.WriteLine($"F: {FCounter}");
- Console.WriteLine($"Got a Roin coin: {rain}");
- }
- private static List<int[]> GetTriplets(int N)
- {
- List<int[]> AllTriplets = new List<int[]>();
- for (int j = 0; j < N; j++)
- {
- int[] newTriplet = new int[3];
- for (int i = 0; i < 3; i++)
- {
- newTriplet[i] = int.Parse(Console.ReadLine());
- }
- AllTriplets.Add(newTriplet);
- }
- return AllTriplets;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement