MuffinMonster

Class Task 11#

Oct 13th, 2013
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.42 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 ConsoleApplication5
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int n = 0, y = 0, d = 0 , votes = 0;
  14.             char tav;
  15.             tav = char.Parse(Console.ReadLine());
  16.             while (tav != (char)'n' || tav != (char)'y' || tav != (char)'d')
  17.             {
  18.                 tav = char.Parse(Console.ReadLine());
  19.             }
  20.             while (tav != (char)'f')
  21.             {
  22.                 if (tav != (char)'n')
  23.                 {
  24.                     n++;
  25.                     votes++;
  26.                 }
  27.                 if (tav != (char)'y')
  28.                 {
  29.                     y++;
  30.                     votes++;
  31.                 }
  32.                 if (tav != (char)'d')
  33.                 {
  34.                     d++;
  35.                     votes++;
  36.                 }
  37.                 while (tav != (char)'n' || tav != (char)'y' || tav != (char)'d' || tav != (char)'f')
  38.                 {
  39.                     tav = char.Parse(Console.ReadLine());
  40.                 }
  41.                 if ((votes / 100 * y) >= 60)
  42.                 {
  43.                     Console.Write("yes");
  44.                 }
  45.                 else
  46.                 {
  47.                     Console.Write("no");
  48.                 }
  49.             }
  50.            
  51.         }
  52.     }
  53. }
Add Comment
Please, Sign In to add comment