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 ConsoleApplication88
- {
- class Program
- {
- public static int myf(int zahl1, int zahl2, params int[] liste)
- {
- int maxi = 0;
- int mini = 999;
- for (int i = 1; i < liste.Length ; i++)
- {
- if (liste[i] > maxi)
- {
- maxi = liste[i];
- }
- else if (liste[i] < mini)
- {
- mini = liste[i];
- }
- }
- zahl1 = maxi;
- mini = zahl2;
- return mini;
- }
- static void Main()
- {
- int[] liste = { 25, 2, 12, 7, 3, 88, 9 };
- int erg1;
- int zahl2 = 2;
- erg1 = myf(1, zahl2, liste);
- Console.WriteLine("Zahl {0}", erg1);
- Console.WriteLine("Zahl {0}", zahl2);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement