Viktomirova

04._Exam_Retention

Jun 14th, 2020
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.95 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _04._Exam_Retention
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double students = double.Parse(Console.ReadLine());
  10.             int seasons = int.Parse(Console.ReadLine());
  11.             double newStudents = 0;
  12.  
  13.             for (int i = 1; i <= seasons; i++)
  14.             {
  15.                 for (int j = 1; j <= 2; j++)
  16.                 {
  17.                     students = Math.Ceiling(students * 90 / 100);
  18.                 }
  19.                 students = Math.Ceiling(students * 80 / 100);
  20.                 if (i % 3 == 0)
  21.                 {
  22.                     newStudents = Math.Ceiling(students * 15 / 100);
  23.                 }
  24.                 else
  25.                 {
  26.                     newStudents = Math.Ceiling(students * 5 / 100);
  27.                 }
  28.                 students += newStudents;
  29.             }
  30.             Console.WriteLine($"Students: {students}");
  31.  
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment