gt; SQL- gt; Clear (); - gt ; ADOQuery1- gt; SQL- gt; Add ( SELECT * FROM Morticd10, Country_codes ); - gt; ADOQuery1- gt; SQL- gt; Add ( where Morticd10.Country=Country_codes.country and Year=2 001 raquo ;); - gt; ADOQuery1- gt; SQL- gt; Add ( and Cause=1000 and Country_codes.name=Pr1 and Sex=1raquo;);-gt;ADOQuery1-gt;Parameters-gt;ParamByName(laquo;Pr1raquo;)-gt;Value=Cntr;-gt;ADOQuery1-gt;Active =True; - gt; ADOQuery1- gt; Open (); [0]=Form1- gt; ADOQuery1- gt; Fields- gt; FieldByNumber (11) - gt; AsInteger; (i=1; i lt; 26; i ++) [i]=Form1-gt;ADOQuery1-gt;Fields-gt;FieldByNumber(i+11)-gt;AsInteger*1.0/P1[0];-gt;ADOQuery1-gt;Close();P1;
}
//---------------------------------------------------------------------------__fastcall TForm1 :: B1Click (TObject * Sender)
{i, j, k, a [26] [26] [26]; * P0=new float [26], * P1=new float [26], * P2=new float [ 26]; (E1- gt; Text!= ) {= Zapr0 (P0, E1- gt; Text);=Zapr1 (P1, E1- gt; Text);
} {( Введіть країну ) ;;
} [0]=P0 [0] * P1 [0]; (i=1; i lt; 26; i ++) {[i]=0; (j=1; j lt; 26; j ++) (k=1; k lt; 26; k ++) [i] [j] [k]=0;
} (i=1; i lt; 26; i ++) (j=1; j lt; 26; j ++) (k=1; k lt; 26; k ++) [i] [j] [max (i, j)]=1; (i=1; i lt; 26; i ++) (j=1; j lt; 26; j ++) (k=1; k lt; 26; k ++) [k] +=a [i ] [j] [k] * P0 [i] * P1 [j]; (int i=1; i lt; 26; i ++) {- gt; Cells [i] [1]=P0 [i]; - gt; Cells [i] [2]=P1 [i]; - gt; Cells [i] [3]=P2 [i];
} - gt; Clear (); - gt; Clear (); - gt; Clear (); (i=1; i lt; 26; i ++) {- gt; Add (P0 [i ], i, clRed); - gt; Add (P1 [i], i, clGreen); - gt; Add (P2 [i], i, clPurple);
}
}
//---------------------------------------------------------------------------