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;
- namespace _2_zadacha
- {
- class Program
- {
- static void Main(string[] args)
- {
- double pricepit = double.Parse(Console.ReadLine());
- int colpit = int.Parse(Console.ReadLine());
- int colkoz = int.Parse(Console.ReadLine());
- int colgev = int.Parse(Console.ReadLine());
- int colcor = int.Parse(Console.ReadLine());
- double budget = double.Parse(Console.ReadLine());
- double allprice = (pricepit * colpit) + ((1.2 * pricepit) * colkoz) + ((0.72 * pricepit) * colgev) + ((0.72 * pricepit + 1.2) * colcor);
- if (budget >= allprice)
- Console.WriteLine("Yes! {0:.##} leva left.", budget - allprice);
- else
- Console.WriteLine("No! {0:.##} leva need.", allprice - budget);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement