Не выводятся индексы чисел массива, которые != max

Рейтинг: 0Ответов: 0Опубликовано: 24.10.2014
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;
        }

    }
}

Ответы

Ответов пока нет.