Advertisement
Guest User

Untitled

a guest
May 24th, 2018
164
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.  
  3. namespace MakeItRain
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.             bool isTrue = false;
  11.             int trueCount = 0;
  12.             int falseCount = 0;
  13.  
  14.  
  15.             for (int i = 0; i < n; i++)
  16.             {
  17.                 int a = int.Parse(Console.ReadLine());
  18.                 int b = int.Parse(Console.ReadLine());
  19.                 int c = int.Parse(Console.ReadLine());
  20.                
  21.                 if(b != 0)
  22.                 {
  23.                     isTrue = a / b == c;
  24.                 }
  25.                 else
  26.                 {
  27.                     isTrue = false;
  28.                 }
  29.  
  30.                 if (isTrue)
  31.                 {
  32.                     trueCount += 84;
  33.                     falseCount = falseCount / (84 / 10);
  34.                 }
  35.                 else
  36.                 {
  37.                     falseCount += 70;
  38.                     trueCount = trueCount / (70 / 10);
  39.                 }
  40.             }
  41.  
  42.             bool isResult = false;
  43.             if (falseCount != 0)
  44.             {
  45.                 if (trueCount / falseCount % 2 == 0)
  46.                 {
  47.                     isResult = true;
  48.                 }
  49.             }
  50.  
  51.             Console.WriteLine($"T: {trueCount}");
  52.             Console.WriteLine($"F: {falseCount}");
  53.             Console.WriteLine($"Got a Roin coin: {isResult}");
  54.         }
  55.     }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement