bullit3189

Google Searches - TF-MidExam-28Oct18

Jan 27th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4.  
  5. namespace _01GoogleSearches
  6. {
  7. class Program
  8. {
  9. static void Main(string[] args)
  10. {
  11. int totalDays = int.Parse(Console.ReadLine());
  12. int users = int.Parse(Console.ReadLine());
  13. double moneyPerUserSearch = double.Parse(Console.ReadLine());
  14.  
  15.  
  16. double totalMoney = 0;
  17.  
  18. for (int i = 1; i <= users; i++)
  19. {
  20. int words = int.Parse(Console.ReadLine());
  21. double currMoney = 0;
  22.  
  23. if (words>5)
  24. {
  25. continue;
  26. }
  27. currMoney = moneyPerUserSearch;
  28.  
  29. if (words==1)
  30. {
  31. currMoney = currMoney * 2.0;
  32. }
  33. if (i%3==0)
  34. {
  35. currMoney *= 3.0;
  36. }
  37.  
  38. totalMoney += currMoney;
  39. }
  40.  
  41. double grandTotal = totalMoney * totalDays;
  42.  
  43. Console.WriteLine($"Total money earned for {totalDays} days: {grandTotal:f2}");
  44. }
  45. }
  46. }
Add Comment
Please, Sign In to add comment