Advertisement
simonradev

FixedCode

Feb 13th, 2017
392
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.73 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _11.Cinema
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string projekciq = Console.ReadLine();
  14.             double row = double.Parse(Console.ReadLine());
  15.             double column = double.Parse(Console.ReadLine());
  16.  
  17.             double siting = row * column;
  18.  
  19.             if (projekciq == "Premiere")
  20.             {
  21.                                                 //тук на бъгва заради това че конкатенираш резултата със стринг
  22.                                                 //и след това се опитваш да изкараш 2 числа след
  23.                                                 //десетичната запетая на един текст.
  24.                                                 //когато имаш (нещо си) + (string) цялото става стринг
  25.                                                 //    |
  26.                                                 //    V
  27.                 Console.WriteLine("{0:f2} Leva", siting * 12.0);
  28.             }
  29.  
  30.             else if (projekciq == "Normal")
  31.             {                                   //тук е същото
  32.                 Console.WriteLine("{0:f2} Leva", siting * 7.5);
  33.             }
  34.  
  35.             else if (projekciq == "Discount")
  36.             {                                   //тук е същото
  37.                 Console.WriteLine("{0:f2} Leva", siting * 5.0);
  38.             }
  39.             else
  40.             {
  41.                 Console.WriteLine("error");
  42.             }
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement