Advertisement
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;
- using System.Threading.Tasks;
- namespace ConsoleApplication3
- {
- class Program
- {
- public static double Minimum(params double[] tab)
- {
- double minimum = tab[0];
- for (int i = 0; i < tab.Length; i++)
- {
- if (minimum > tab[i])
- {
- minimum = tab[i];
- }
- }
- return minimum;
- }
- static void Main(string[] args)
- {
- Console.WriteLine("Podaj 5 liczb");
- double a, b, c, d, e;
- a = Convert.ToDouble(Console.ReadLine());
- b = Convert.ToDouble(Console.ReadLine());
- c = Convert.ToDouble(Console.ReadLine());
- d = Convert.ToDouble(Console.ReadLine());
- e = Convert.ToDouble(Console.ReadLine());
- Console.WriteLine("Minimum z liczb " +a+ " , " + b + " , " + c + " , " + d + " , " + e+ " to: " + Minimum(a,b,c,d,e) );
- Console.WriteLine("Minimum z liczb(2,3 2,9 104 22,4) to:"+ Minimum(2.3,2.9,104,22.4));
- Console.WriteLine("Minimum z liczb (10 2 3 4 9) to: " + Minimum(10,2,3,4,9));
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement