Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp7
- {
- class Program
- {
- static void Main(string[] args)
- {
- int Owndogs = int.Parse(Console.ReadLine());
- int OtherAnimals = int.Parse(Console.ReadLine());
- //string currency = "lv."; излишно
- double price = 2.50;
- double price1 = 4;
- double totalprice = Owndogs * price;
- double totalprice2 = OtherAnimals * price1;
- // double result = totalprice + totalprice2; // <= този начин е по лесен и по малко се пише и 90 % го правят така
- // Console.WriteLine("{result:f2} lv."); // вярно
- Console.WriteLine("{0:F2} lv.", totalprice + totalprice2); // вярно
- // Console.WriteLine("{0:F2}", totalprice + totalprice2 + "lv."); // грешно
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement