Advertisement
Guest User

Untitled

a guest
Nov 17th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _1project
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int x, z;
  10. int op; //toto je komentar /
  11.  
  12. Console.WriteLine("zadej cislo");
  13. x = Console.Read() - '0';
  14. Console.ReadLine();
  15.  
  16. Console.WriteLine("zadej druhy cislo");
  17. z = Console.Read() - '0';
  18. Console.ReadLine();
  19.  
  20. Console.WriteLine("zadej znamenko");
  21. op = Console.Read();
  22. Console.ReadLine();
  23.  
  24.  
  25. if (op == '+')
  26. {
  27. Console.WriteLine("vysledek je {0}", x + z);
  28. }
  29.  
  30. if (op == '-')
  31. {
  32. Console.WriteLine("vysledek je {0}", x - z);
  33. }
  34.  
  35. if (op == '*')
  36. {
  37. Console.WriteLine("vysledek je {0}", x * z);
  38. }
  39.  
  40. if (op == '/')
  41. {
  42. if (z == 0)
  43. {
  44. Console.WriteLine("na deleni nulou ti mrdam");
  45. }
  46. else
  47. {
  48. Console.WriteLine("vysledek je {0}", x / z);
  49. }
  50. }
  51.  
  52. if (op == 'm')
  53. {
  54. if (z > x)
  55. {
  56. Console.WriteLine("vetsi je z {0}", z);
  57. }
  58. else if (z < x)
  59. {
  60. Console.WriteLine("vetsi je x {0}", x);
  61. }
  62. else
  63. {
  64. Console.WriteLine("Napsal si dve stejny cisla kokote kdyz je odectes dostanes sebe");
  65. }
  66. }
  67. //if (podminka) prikaz;
  68. //if (podminka) { prikaz; prikaz; prikaz; ... }
  69.  
  70. Console.WriteLine("hovno");
  71.  
  72. Console.ReadLine();
  73. }
  74. }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement