Advertisement
Guest User

Untitled

a guest
Nov 24th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 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 mislim_si_cislo
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int cislo;
  14. int x, p;
  15.  
  16. x = 50;
  17. p = 50;
  18. Console.WriteLine("Mysli si číslo od 1 do 100. Uhodnu ho");
  19. cislo = Console.Read();
  20. Console.ReadLine();
  21.  
  22. while (cislo != 'a')
  23. {
  24.  
  25. Console.WriteLine("Je to? {0}. Ano nebo Ne. a/n", x);
  26. cislo = Console.Read();
  27.  
  28.  
  29.  
  30. if (cislo == 'n')
  31. {
  32. Console.WriteLine("doprdele, je větší nebo menší? v/n");
  33.  
  34. }
  35. else if (cislo == 'v')
  36. {
  37. p = p / 2;
  38. x = x + p;
  39.  
  40. }
  41. else if (cislo == 'm')
  42. {
  43. p = p / 2;
  44. x = x - p;
  45. }
  46. else if (cislo == 'a')
  47. {
  48. Console.WriteLine("Jo ty píčo mám tě. Věděl jsem to.");
  49. Console.ReadLine();
  50. }
  51. else
  52. {
  53. Console.WriteLine("Kokote Nechápu tě");
  54.  
  55. }
  56. Console.ReadLine();
  57.  
  58. }
  59. }
  60. }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement