/* קלט: מספר חשבונות בנק, ורשימת הסכומים בחשבונות אלה פלט: הסכום הגבוה ביותר ברשימה */ using System; public class FindMax { public static void Main() { int howMany; //מספר הערכים ברשימה int balance; // הסכום התורן int max; // הסכום הגבוה ביותר מבין אלה שנקלטו Console.Write("Enter the amount of accounts: "); howMany = int.Parse(Console.ReadLine()); Console.Write("Enter the first balance: "); balance = int.Parse(Console.ReadLine()); max = balance; //אתחול המקסימום לסכום הראשון for (int i = 2; i <= howMany; i++) { Console.Write("Insert balance of account {0}: ", i); balance = int.Parse(Console.ReadLine()); if (balance > max) //הסכום הנוכחי גדול מהמקסימום הנוכחי max = balance; } // for Console.WriteLine("The maximum is {0}", max); }// Main }// FindMax