SHARE
TWEET

Untitled

a guest Oct 14th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace ConsoleApp7
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int Owndogs = int.Parse(Console.ReadLine());
  10.             int OtherAnimals = int.Parse(Console.ReadLine());
  11.             //string currency = "lv."; излишно
  12.  
  13.             double price = 2.50;
  14.             double price1 = 4;
  15.             double totalprice = Owndogs * price;
  16.             double totalprice2 = OtherAnimals * price1;
  17.  
  18.             // double result = totalprice + totalprice2;  // <= този начин е по лесен и по малко се пише и 90 % го правят така
  19.             // Console.WriteLine("{result:f2} lv."); // вярно
  20.  
  21.             Console.WriteLine("{0:F2} lv.", totalprice + totalprice2); // вярно
  22.  
  23.             // Console.WriteLine("{0:F2}", totalprice + totalprice2 + "lv."); // грешно
  24.         }
  25.     }
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top