Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace p18_9
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[]a=new int[5];
- for (int i = 0; i < 5; i++)
- {
- a[i] = int.Parse(Console.ReadLine());
- }
- int min=a[0], max=a[0], count = 0, pmax = 0;
- for (int i = 0; i < 5; i++)
- {
- if (a[i] > max) { max = a[i]; pmax = i+1; }
- if (a[i] < min) { min = a[i];}
- }
- for (int i = 0; i < 5; i++)
- if (a[i] == max)
- count++;
- Console.WriteLine(min + " " + max + " " + pmax + " " + count);
- }
- }
- }
Add Comment
Please, Sign In to add comment