Advertisement
Guest User

Untitled

a guest
Nov 19th, 2017
59
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 myslim_si_znak
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int cislo, cifra;
  14. int x;
  15.  
  16. cislo = 0;
  17. x = 54;
  18. while (cislo != x)
  19. {
  20. Console.WriteLine("Myslím si dvouciferné číslo, uhodni ho.");
  21. cifra = Console.Read();
  22.  
  23.  
  24.  
  25. while ((cifra >= '0') && (cifra <= '9'))
  26. {
  27.  
  28. cislo = cislo * 10 + cifra - '0';
  29.  
  30. cifra = Console.Read();
  31.  
  32. }
  33. Console.WriteLine("nacetl jsem {0} pane", cislo);
  34.  
  35.  
  36. if (cislo > 99)
  37. {
  38. Console.WriteLine("Kokote, řekl jsem dvouciferné číslo");
  39. cislo = cislo - cislo;
  40. }
  41. else if (cislo < x)
  42.  
  43. {
  44. Console.WriteLine("myslím si vyšší číslo");
  45. cislo = cislo - cislo;
  46.  
  47. }
  48. else if (cislo > x)
  49. {
  50. Console.WriteLine("myslím si menšší číslo");
  51. cislo = cislo - cislo;
  52.  
  53. }
  54. else
  55. {
  56. Console.WriteLine("Správně ty senzibile mé číslo je {0}", x);
  57. Console.ReadLine();
  58. }
  59. }
  60. }
  61. }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement