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;
- using csharp;
- namespace csharp
- {
- class Program
- {
- static void Main(string[] args)
- {
- List<int> vektori = MbushVektorin();
- }
- static int[] MbushVektorin()
- {
- //List<int> vektori = new List<int>();
- int[] vek = new int[31];
- for (int i = 0; i < 31; i++)
- {
- vek[i] = int.Parse(Console.ReadLine());
- //vektori.Add(int.Parse(Console.ReadLine()));
- }
- return vek;
- }
- public static void tempNenMesatare(int[] temp)
- {
- float mesatare = 0;
- float shuma = 0;
- for (int i = 0; i < temp.Length; i++)
- {
- shuma += temp[i];
- }
- mesatare = shuma / temp.Length;
- Console.WriteLine("Muajt qe e kane temparaturen me te vogel se mesatarja jane: ");
- for (int j = 0; j < temp.Length; j++)
- {
- if (temp[j] < mesatare)
- {
- Console.WriteLine(temp[j]);
- }
- }
- }
- public static int tempMinimale(int[] temp)
- {
- int min = temp[0];
- for (int i = 0; i < temp.Length; i++)
- {
- if (temp[i] < min)
- min = temp[i];
- }
- return min;
- }
- public static void kerkesa4(int[] temp, int vleraT)
- {
- int count = 0;
- for (int i = 0; i < temp.Length; i++)
- {
- if (temp[i] == vleraT)
- {
- count++;
- }
- }
- }
- public void renditVektori(int[] temp)
- {
- bool swapped = true;
- int j = 0;
- int tmp;
- while (swapped)
- {
- swapped = false;
- j++;
- for (int i = 0; i < temp.Length - j; i++)
- {
- if (temp[i] > temp[i + 1])
- {
- tmp = temp[i];
- temp[i] = temp[i + 1];
- temp[i + 1] = tmp;
- swapped = true;
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement