daily pastebin goal
89%
SHARE
TWEET

Untitled

a guest Jan 20th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         int[] luvut = new int[5];
  2.             int[] luvut2 = new int[5];
  3.             int[] luku = new int[5];
  4.             int suurin, pienin, luku;
  5.            
  6.  
  7.             Console.WriteLine("Anna lukuja 5kpl");
  8.  
  9.             for (int i = 0; i < 5; i++)
  10.             {
  11.                 luku = Int32.Parse(Console.ReadLine());
  12.                 luku[i] = luku;
  13.  
  14.             }
  15.  
  16.             for (int i = 0; i < luvut.Length; i++)
  17.             {
  18.  
  19.                 if (luku[i] % 2 == 0) luvut[i] = luku[i];
  20.                 else if (luku[i] % 2 == 1)
  21.                 { luvut2[i] = luvut[i]; }
  22.  
  23.             }
  24.  
  25.             suurin = luvut2.Max();
  26.             pienin = luvut.Min();
  27.  
  28.  
  29.             Console.WriteLine("Jakojäännös on: " + (suurin / pienin));
  30.             Console.Read();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top