Advertisement
osman1997

imena

Oct 19th, 2020
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4. class Program
  5. {
  6.  
  7. static void Main()
  8. {
  9. List<string> names = new List<string>();
  10.  
  11. string command = string.Empty;
  12.  
  13. while (command != "end")
  14. {
  15. command = Console.ReadLine();
  16.  
  17. names.Add(command);
  18. }
  19.  
  20. names.RemoveAt(names.Count - 1);
  21.  
  22. for (int i = 0; i < names.Count; i++)
  23. {
  24. Console.WriteLine(names[i]);
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement