85 lines
2.1 KiB
C#
85 lines
2.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Collections;
|
|
|
|
namespace ConsoleApp1
|
|
{
|
|
class Program
|
|
{
|
|
static void Feladat1()
|
|
{
|
|
ArrayList arlist = new ArrayList();
|
|
Random random = new Random();
|
|
for (int i = 0; i < 100; ++i)
|
|
{
|
|
int x = random.Next(100, 500);
|
|
arlist.Add(x);
|
|
}
|
|
|
|
foreach (int i in arlist)
|
|
{
|
|
Console.WriteLine(i);
|
|
}
|
|
|
|
int a = arlist.Count;
|
|
int b = arlist.Capacity;
|
|
bool c = arlist.Contains(125);
|
|
arlist.Sort();
|
|
Console.WriteLine("");
|
|
Console.WriteLine(a);
|
|
Console.WriteLine(b);
|
|
Console.WriteLine(c);
|
|
Console.WriteLine("");
|
|
|
|
foreach (int i in arlist)
|
|
{
|
|
Console.WriteLine(i);
|
|
}
|
|
arlist.Clear();
|
|
|
|
foreach (int i in arlist)
|
|
{
|
|
Console.WriteLine(i);
|
|
}
|
|
|
|
|
|
}
|
|
|
|
static void Feladat2()
|
|
{
|
|
string maidatum = "";
|
|
ArrayList date_0 = new ArrayList();
|
|
ArrayList date_1 = new ArrayList();
|
|
ArrayList date_2 = new ArrayList();
|
|
ArrayList date_3 = new ArrayList();
|
|
ArrayList date_4 = new ArrayList();
|
|
maidatum = Console.ReadLine();
|
|
do
|
|
{
|
|
string[] date = maidatum.Split('.');
|
|
date_0.Add(date[0]);
|
|
date_1.Add(date[1]);
|
|
date_2.Add(date[2]);
|
|
date_3.Add(date[3]);
|
|
date_4.Add(date[4]);
|
|
maidatum = Console.ReadLine();
|
|
} while (maidatum != "0");
|
|
|
|
for (int i = 0; i < date_0.Count; i++)
|
|
{
|
|
Console.WriteLine($"{date_0[i]}.{date_1[i]}.{date_2[i]} {date_3[i]}:{date_4[i]}");
|
|
}
|
|
|
|
|
|
}
|
|
static void Main(string[] args)
|
|
{
|
|
Feladat2();
|
|
Console.ReadLine();
|
|
}
|
|
}
|
|
}
|