Advertisement
Guest User

Untitled

a guest
Feb 17th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.46 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using csharp;
  7.  
  8. namespace csharp
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             List<int> vektori = MbushVektorin();
  15.         }
  16.  
  17.         static int[] MbushVektorin()
  18.         {
  19.             //List<int> vektori = new List<int>();
  20.             int[] vek = new int[31];
  21.  
  22.             for (int i = 0; i < 31; i++)
  23.             {
  24.                 vek[i] = int.Parse(Console.ReadLine());
  25.                 //vektori.Add(int.Parse(Console.ReadLine()));
  26.             }
  27.  
  28.             return vek;
  29.         }
  30.  
  31.         public static void tempNenMesatare(int[] temp)
  32.         {
  33.             float mesatare = 0;
  34.             float shuma = 0;
  35.  
  36.             for (int i = 0; i < temp.Length; i++)
  37.             {
  38.                 shuma += temp[i];
  39.             }
  40.  
  41.             mesatare = shuma / temp.Length;
  42.             Console.WriteLine("Muajt qe e kane temparaturen me te vogel se mesatarja jane: ");
  43.             for (int j = 0; j < temp.Length; j++)
  44.             {
  45.                 if (temp[j] < mesatare)
  46.                 {
  47.                     Console.WriteLine(temp[j]);
  48.                 }
  49.             }
  50.         }
  51.  
  52.         public static int tempMinimale(int[] temp)
  53.         {
  54.             int min = temp[0];
  55.  
  56.             for (int i = 0; i < temp.Length; i++)
  57.             {
  58.                 if (temp[i] < min)
  59.                     min = temp[i];
  60.             }
  61.  
  62.             return min;
  63.         }
  64.  
  65.         public static void kerkesa4(int[] temp, int vleraT)
  66.         {
  67.             int count = 0;
  68.  
  69.             for (int i = 0; i < temp.Length; i++)
  70.             {
  71.                 if (temp[i] == vleraT)
  72.                 {
  73.                     count++;
  74.                 }
  75.             }
  76.         }
  77.  
  78.         public void renditVektori(int[] temp)
  79.         {
  80.             bool swapped = true;
  81.             int j = 0;
  82.             int tmp;
  83.             while (swapped)
  84.             {
  85.                 swapped = false;
  86.                 j++;
  87.                 for (int i = 0; i < temp.Length - j; i++)
  88.                 {
  89.                     if (temp[i] > temp[i + 1])
  90.                     {
  91.                         tmp = temp[i];
  92.                         temp[i] = temp[i + 1];
  93.                         temp[i + 1] = tmp;
  94.                         swapped = true;
  95.                     }
  96.                 }
  97.             }
  98.         }
  99.  
  100.  
  101.     }
  102. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement