Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- namespace _01GoogleSearches
- {
- class Program
- {
- static void Main(string[] args)
- {
- int totalDays = int.Parse(Console.ReadLine());
- int users = int.Parse(Console.ReadLine());
- double moneyPerUserSearch = double.Parse(Console.ReadLine());
- double totalMoney = 0;
- for (int i = 1; i <= users; i++)
- {
- int words = int.Parse(Console.ReadLine());
- double currMoney = 0;
- if (words>5)
- {
- continue;
- }
- currMoney = moneyPerUserSearch;
- if (words==1)
- {
- currMoney = currMoney * 2.0;
- }
- if (i%3==0)
- {
- currMoney *= 3.0;
- }
- totalMoney += currMoney;
- }
- double grandTotal = totalMoney * totalDays;
- Console.WriteLine($"Total money earned for {totalDays} days: {grandTotal:f2}");
- }
- }
- }
Add Comment
Please, Sign In to add comment