using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { public static int Main(string[] args) { int i, size = 5, max; int[] a = new int[size]; for (i = 0; i < size; i++) { Console.Write("a[{0}] = ", i); a[i] = int.Parse(Console.ReadLine()); } max = a[0]; for (i = 1; i < size; i++) { if (a[i] > max) max = a[i]; } if (a[i] != max) for (i = 0; i < size; i++) { Console.WriteLine("{0}",a[i]); } Console.WriteLine("max={0}", max); Console.ReadKey(); return 0; } } } - one@BoDyak, Try to write more detailed questions. Explain what you see the problem, how to reproduce it, etc. - Nicolas Chabanovsky ♦
- one@BoDyak: Have you tried using a debugger? Try the F10 and F11 keys, you will like it. - VladD
|