Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _05._Exam_Preparation
- {
- class Program
- {
- static void Main(string[] args)
- {
- int students = int.Parse(Console.ReadLine());
- int problems = int.Parse(Console.ReadLine());
- int energy = int.Parse(Console.ReadLine());
- int questions = 0;
- int problemCounter = 0;
- while (students > 10)
- {
- problemCounter += problems;
- energy += problems * 2;
- students -= problems;
- questions += students * 2;
- energy -= students * 2 * 3;
- if (energy <= 0)
- {
- Console.WriteLine("The trainer is too tired!");
- Console.WriteLine($"Questions asked: {questions}");
- return;
- }
- students += students / 10;
- }
- Console.WriteLine("The students are too few!");
- Console.WriteLine($"Problems solved: {problemCounter}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment