Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 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 ConsoleApp37
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int Participants = int.Parse(Console.ReadLine());
  14. int First = int.Parse(Console.ReadLine());
  15.  
  16. var Second = First - (First * 0.20);
  17. var Third = Second - (Second * 0.10);
  18. var Sum = Math.Truncate(First + Second + Third);
  19. var Half = Participants / 2;
  20. var VotesNeeded = Math.Truncate(Math.Abs(Half - Sum));
  21.  
  22. if (Sum >= Half)
  23. {
  24. Console.WriteLine($"First three languages have {VotesNeeded} votes more");
  25. }
  26. else if (Sum < Half)
  27. {
  28. Console.WriteLine($"First three languages have {VotesNeeded} votes less of half votes");
  29. }
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement