Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int maxFail = int.Parse(Console.ReadLine());
- int fail = 0;
- int solved = 0;
- double gradesSum = 0;
- string last = "";
- bool isFailed = true;
- while (fail < maxFail)
- {
- string name = Console.ReadLine();
- if ("Enough" == name)
- {
- isFailed = false;
- break;
- }
- int grade = int.Parse(Console.ReadLine());
- if (grade <= 4)
- {
- fail++;
- }
- gradesSum += grade;
- solved++;
- last = name;
- }
- if (isFailed)
- {
- Console.WriteLine($"Tup si. Imash {fail} greshki.");
- Console.WriteLine("Probvai pak tupson");
- }
- else
- {
- Console.WriteLine("Mn dobre maniashki!");
- Console.WriteLine($"sredniq ti e: {gradesSum/solved:F2}. Obshto reshi tolkoz: {solved}. Poslednata ti zadacha beshe: {last}.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement