Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace P13
- {
- class Program
- {
- public static void Main(string[] args)
- {
- string [] torpe_kezfogo = {"Tudor:Vidor", "Tudor:Hapci", "Szende:Tudor", "Hapci:Vidor", "Kuka:Vidor", "Morgo:Kuka", "Szundi:Tudor"};
- string [] torpe = new string [torpe_kezfogo.Length*2];
- string [] tp=new string[2];
- for (int i = 0; i < torpe_kezfogo.Length; i++) {
- tp = torpe_kezfogo[i].Split(':');
- torpe[i*2]=tp[0];
- torpe[i*2+1]=tp[1];
- }
- Array.Sort(torpe);
- int k=0, db;
- while (k<torpe.Length) {
- Console.Write(torpe[k]);
- db=0;
- while(k+db<torpe.Length && torpe[k+db]==torpe[k]) db++;
- Console.WriteLine(": "+db);
- k=k+db;
- }
- Console.Write("Press any key to continue . . . ");
- Console.ReadKey(true);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment