Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _01._Google_Searches
- {
- class Program
- {
- static void Main(string[] args)
- {
- int totalDays = int.Parse(Console.ReadLine());
- int numberOfUsers = int.Parse(Console.ReadLine());
- double money = double.Parse(Console.ReadLine());
- double sum = 0;
- for (int i = 1; i <= numberOfUsers; i++)
- {
- int numberOfWords = int.Parse(Console.ReadLine());
- if (numberOfWords == 1 && i % 3 !=0)
- {
- sum = sum + (money * 2);
- }
- else if (numberOfWords > 1 && numberOfWords <= 5 && i % 3 != 0)
- {
- sum = sum + money;
- }
- if (numberOfWords == 1 && i % 3 == 0 )
- {
- sum = sum + ((money * 2) * 3);
- }
- else if (numberOfWords > 1 && numberOfWords <= 5 && i % 3 == 0)
- {
- sum = sum + (money * 3);
- }
- }
- sum = sum * totalDays;
- Console.WriteLine($"Total money earned for {totalDays} days: {sum:f2}");
- }
- }
- }
Add Comment
Please, Sign In to add comment