woody1000

HW 1-3. Консольное меню - не доделал

Feb 9th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. using System;
  2.  
  3. namespace HW
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string number;
  10. int name;
  11. int name1;
  12. string userName = "w" ;
  13. string nameUser;
  14. string pass;
  15. string pass_1 = "qwerty";
  16. bool t;
  17. bool passAccepted;
  18.  
  19. while (t = true)
  20. {
  21. name =Convert.ToInt32( Console.ReadLine());
  22.  
  23. if(name == 1)
  24. {
  25. t = true;
  26. Console.WriteLine("Напиши имя");
  27. userName = Console.ReadLine();
  28. passAccepted = true;
  29. name1 = Convert.ToInt32(Console.ReadLine());
  30.  
  31. }
  32.  
  33. else if(name == 2)
  34. {
  35. t = true;
  36. Console.BackgroundColor = ConsoleColor.Cyan;
  37. Console.Clear();
  38. Console.WriteLine("23");
  39. }
  40.  
  41. else if (name == 3)
  42. {
  43. t = true;
  44. Console.WriteLine("Введите пароль");
  45.  
  46. pass = Console.ReadLine();
  47. if(pass == pass_1)
  48. {
  49. passAccepted = true;
  50. }
  51.  
  52.  
  53.  
  54. }
  55.  
  56. if (name == 4)
  57. {
  58. t = true;
  59.  
  60. if (passAccepted = true)
  61. {
  62. Console.WriteLine(userName);
  63. }
  64. else
  65. Console.WriteLine("dfjhsdjf");
  66. }
  67.  
  68.  
  69.  
  70. if (t = false)
  71.  
  72. break;
  73. }
  74.  
  75.  
  76. }
  77. }
  78. }
Add Comment
Please, Sign In to add comment