Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.IO;
- namespace ConsoleApp16
- {
- class Program
- {
- static void Main(string[] args)
- {
- string path = @"C:\Users\pclab\Desktop\mitsos" + 2 + ".txt";
- List<string> names = new List<string>() { "Hector", "Basilis", "Mixalis" };
- List<string> surnames = new List<string>() { "Gatsos", "Paspas", "Taspsa" };
- List<string> salaries = new List<string>() { "50000", "3000", "4000" };
- List<string> ages = new List<string>() { "33", "9", "65" };
- List<string> content = new List<string>();
- Console.WriteLine("Dose onoma");
- string name = Console.ReadLine();
- names.Add(name);
- Console.WriteLine("Dose epitheto");
- string epitheto = Console.ReadLine();
- surnames.Add(epitheto);
- Console.WriteLine("Dose salary");
- string salary = Console.ReadLine();
- salaries.Add(salary);
- Console.WriteLine("Dose age");
- string age = Console.ReadLine();
- ages.Add(age);
- for (int i = 0; i < names.Count; i++)
- {
- var str = string.Join(",", names[i], surnames[i], salaries[i], ages[i]);
- content.Add(str);
- }
- foreach (var item in content)
- {
- Console.WriteLine(item);
- }
- File.WriteAllLines(path, content);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement