daily pastebin goal
64%
SHARE
TWEET

Untitled

a guest Jan 16th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public string przypiszKlase(List<Tabela> calosc, TextBox textBoxA1, TextBox textBoxA2, TextBox textBoxA3, TextBox textBoxA4)
  2.         {
  3.             decimal wartoscDodanegoA1 = decimal.Parse(textBoxA1.Text.ToString());
  4.             decimal wartoscDodanegoA2 = decimal.Parse(textBoxA2.Text.ToString());
  5.             decimal wartoscDodanegoA3 = decimal.Parse(textBoxA3.Text.ToString());
  6.             decimal wartoscDodanegoA4 = decimal.Parse(textBoxA4.Text.ToString());
  7.             string klasa = "";
  8.             decimal temp = decimal.MaxValue;
  9.  
  10.             foreach (Tabela wiersz in calosc)
  11.             {
  12.                 decimal suma = 0.0M;
  13.                 //x.ToString();
  14.                 suma = potega(wartoscDodanegoA1 - wiersz.A1);
  15.                 suma += potega(wartoscDodanegoA2 - wiersz.A2);
  16.                 suma += potega(wartoscDodanegoA3 - wiersz.A3);
  17.                 suma += potega(wartoscDodanegoA4 - wiersz.A4);
  18.                 //suma = Math.Sqrt(suma);
  19.                 if (suma < temp)
  20.                 {
  21.                     temp = suma;
  22.                     klasa = wiersz.Klasa;
  23.                 }
  24.             }
  25.             return klasa;
  26.         }
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