| 31731 | 2026-09-14 12:52:42 | UjvariErik | Állatkert ** | csharp | Forditási hiba |
namespace Allatkert
{
internal class Program
{
static void Main(string[] args)
{
string[] bemenet = Console.ReadLine().Split(' ');
int n = int.Parse(bemenet[0]);
int m = int.Parse(bemenet[1]);
int[] zsakutca = new int[m+1];
List<int> zsakutcak = new List<int>();
for (int i = 0; i < m; i++)
{
string[] be = Console.ReadLine().Split(' ');
int elso = int.Parse(be[0]);
int masodik = int.Parse(be[1]);
zsakutca[elso]++;
zsakutca[masodik]++;
}
for (int i = 0;i < m; i++)
{
if (zsakutca[i] == 1)
zsakutcak.Add(zsakutca[i]);
}
int maxdb = zsakutca[0];
int maxhely = 0;
for (int i = 1; i < m; i++)
{
if (zsakutca[i] > maxdb)
{
maxdb = zsakutca[i];
maxhely = i;
}
}
Console.WriteLine(zsakutcak.Count + " " + maxhely);
}
}
}
open /var/local/lib/isolate/434/box/main.exe: no such file or directory
main.cs(7,32): error CS0103: The name `Console' does not exist in the current context
main.cs(12,13): error CS0246: The type or namespace name `List' could not be found. Are you missing `System.Collections.Generic' using directive?
main.cs(16,31): error CS0103: The name `Console' does not exist in the current context
main.cs(26,17): error CS0841: A local variable `zsakutcak' cannot be used before it is declared
main.cs(46,13): error CS0103: The name `Console' does not exist in the current context
Compilation failed: 5 error(s), 0 warnings