Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _02._Bonus_Points
- {
- class Program
- {
- static void Main(string[] args)
- {
- int points = int.Parse(Console.ReadLine());
- double bonus = 0; //бонус точки
- //стойността на числото
- if (points <= 100)
- {
- bonus = 5;
- }
- else if (points > 100 && points <= 1000)
- {
- bonus = 0.2 * points;
- }
- else if (points > 1000)
- {
- bonus = 0.1 * points;
- }
- //четно или завършва на 5
- if (points % 2 == 0)
- {
- bonus = bonus + 1;
- //bonus += 1;
- }
- else if (points % 10 == 5)
- {
- bonus = bonus + 2;
- //bonus += 2;
- }
- Console.WriteLine(bonus);
- Console.WriteLine(points + bonus);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment