public static Bucket[] BuildAr (double[] amountAr)
Bucket[] ar = new Bucket[30];
for (int i=0; i<ar.Length; i++)
public static Bucket MaxAmount (Bucket[] ar)
double max = ar[0].GetCurrentAmount();
for (int i=1; i<ar.Length; i++)
if (ar[i].GetCurrentAmount() > max)
max = ar[i].GetCurrentAmount();
public static bool IsExist (Bucket[] ar, Bucket b)
for (int i=0; i<ar.Length; i++)
if (ar[i].GetCapacity() == b.GetCapacity() && ar[i].GetCurrentAmount() == b.GetCurrentAmount())
public static int CntLess50 (Bucket[] ar)
for (int i=0; i<ar.Length; i++)
if (ar[i].GetCurrentAmount() < 50)
ar[i].Fill(50-ar[i].GetCurrentAmount());
public static void PrintArBucket (Bucket[] ar)
for (int i=0; i<ar.Length; i++)
Console.WriteLine(ar[i].ToString());
public static void Main (string[] args)
Console.WriteLine("Hello World");
double[] amountAr = new double[30];
for (int i=0; i<amountAr.Length; i++)
amountAr[i] = double.Parse(Console.ReadLine());
Bucket[] ar = BuildAr(amountAr);
Bucket newb = MaxAmount(ar);
Console.WriteLine(newb.ToString());
Bucket b = new Bucket(100);
Console.WriteLine("exist");
Console.WriteLine("not exist");
Console.WriteLine("there are " + CntLess50(ar) + "buckets less than 50");