fork download
  1. using System;
  2.  
  3. namespace e1
  4. {
  5.  
  6. public struct employee
  7. {
  8. string name;
  9. long id;
  10. public void getData()
  11. {
  12. employee employee1 = new employee();
  13. Console.WriteLine("Введите имя работника: ");
  14. employee1.name = Console.ReadLine();
  15. Console.WriteLine("Введите номер работника: ");
  16. employee1.id = long.Parse(Console.ReadLine());
  17. }
  18. public void putdata(string a, long b)
  19. {
  20. Console.WriteLine("Имя работника: {0} Номер работника: {1}",a, b);
  21. }
  22. }
  23.  
  24. class Program
  25. {
  26. public static void Main(string[] args)
  27. {
  28. employee e1 = new employee();
  29. e1.getData();
  30. e1.putdata(e1.name, e1.id);
  31. Console.Read();
  32. }
  33. }
  34. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(30,18): error CS0122: `e1.employee.name' is inaccessible due to its protection level
prog.cs(30,27): error CS0122: `e1.employee.id' is inaccessible due to its protection level
Compilation failed: 2 error(s), 0 warnings
stdout
Standard output is empty