Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace proben
- {
- class Program
- {
- static void Main(string[] args)
- {
- int quota = int.Parse(Console.ReadLine());
- double wonMoney = 0;
- double lostMoney = 0;
- double fishWorth = 0;
- int fishCounter = 0;
- bool quotaFullfilled = true;
- for (int i = 1; i <= quota; i++)
- {
- int asciiFish = 0;
- string fish = Console.ReadLine();
- if (fish == "Stop")
- {
- quotaFullfilled = false;
- break;
- }
- fishCounter++;
- foreach (char c in fish)
- {
- asciiFish += (char)c;
- }
- double fishKg = double.Parse(Console.ReadLine());
- fishWorth = asciiFish / fishKg;
- if (i % 3 == 0) { wonMoney += fishWorth; }
- else
- {
- lostMoney += fishWorth;
- }
- }
- if (quotaFullfilled)
- {
- Console.WriteLine("Lyubo fulfilled the quota!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment