bacco

Бонус точки

Jan 20th, 2018
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.84 KB | None | 0 0
  1. using System;
  2.  
  3. namespace tESt
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             var points = double.Parse(Console.ReadLine());
  10.             double bonus = 0;
  11.        
  12.  
  13.             if (points <= 100)
  14.             {
  15.                 bonus = bonus + 5;
  16.             }
  17.             else if (points > 1000)
  18.             {
  19.                 bonus = bonus + (points * 0.10);
  20.             }
  21.             else if (points > 100 )
  22.             {
  23.                 bonus = bonus + (points * 0.20);
  24.             }
  25.             if (points % 10 == 5)
  26.             {
  27.                 bonus += 2;
  28.             }
  29.             if (points % 2 == 0)
  30.             {
  31.                 bonus += 1;
  32.             }
  33.  
  34.             Console.WriteLine(bonus);
  35.             Console.WriteLine(points + bonus);
  36.  
  37.  
  38.  
  39.         }
  40.  
  41.  
  42.     }
  43.    
  44. }
Advertisement
Add Comment
Please, Sign In to add comment