add_filter( 'woocommerce_variable_sale_price_html', 'wc_wc20_variation_price_format', 10, 2 );
add_filter( 'woocommerce_variable_price_html', 'wc_wc20_variation_price_format', 10, 2 );
function wc_wc20_variation_price_format( $price, $product ) {
$price = wc_price( min( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', true ) ) );
return $price;
}
program Ex_18;
uses Crt;
const
Row = 5;
Col = 5;
var
Arr: array [1..Row,1..Col] of Real;
i,j: Integer;
procedure SimpleAverage(a, b: Integer);
var
Average: Real;
begin
if b = Col then
begin
a :=a+1;
b := 2;
end;
Average := (Arr[a-1,b]+Arr[a,b-1]+Arr[a+1,b]+Arr[a,b+1]) / 4;
if not ((b=2) and (a=5)) then
begin
SimpleAverage(a,b+1);
Arr[a,b] := Average;
end;
end;
procedure Print(a,b: Integer);
begin
if (a in [1,5]) or (b in [1,5]) then
TextAttr := 4
else
TextAttr := 2;
Write(' ',Arr[a,b]:3:2);
end;
begin
ClrScr;
randomize;
for i := 1 to Row do
begin
for j := 1 to Col do
begin
Arr[i,j] := random(10) + 10;
Print(i,j);
end;
WriteLn;
end;
WriteLn;
i := 2;
j := 2;
SimpleAverage(i,j);
for i := 1 to Row do
begin
for j := 1 to Col do
begin
Print(i,j);
end;
WriteLn;
end;
ReadKey;
end.
function getDay($d, $m, $y) {
$arrDays = array ("воскресенье", "понедельник", "вторник", "среда", "четверг", "пятница", "суббота");
$n = date('w', mktime(0, 0, 0, $m, $d, $y));
return $arrDays[$n];
}
echo getDay(27, 06, 2016);
{*******Перевод К-ой в десятичеую степнь******}
function XToDecimal(Value: String; Fn: Byte): LongInt;
var
Result: Longint;
i: Integer;
{**************Перевод строки в число*************}
function StrToInt(Index: Char): Integer;
var
V, Code: Integer;
begin
Index := UpCase(Index);
if Index in ['0'..'9'] then
Val(Index,V,Code);
if Index in ['A'..'Z'] then
V := Ord(Index) - 55;
StrToInt := V;
end;
{**************************************}
begin
Result := 0;
case Length(Value) of
1: Result := StrToInt(Value[1]);
2: Result := StrToInt(Value[1]) * Fn + StrToInt(Value[2])
else
for i := 1 to Length(Value) do
Result := Result * Fn + StrToInt(Value[i]);
end;
XToDecimal := Result;
end;
{***Перевод из десятичной в К-ую систему**}
function DecimalToX(Value: LongInt; Fn: Byte): String;
const
SizeStr = 255;
var
Buf: array [1..SizeStr] of Char;
Result: String;
i: Integer;
{*********Перевод числа в строку*******}
function IntToStr(Index: Integer): Char;
begin
case Index of
0..9: IntToStr := Chr(Index + 48) ;
10..36: IntToStr := Chr(Index + 55) ;
end;
end;
{**************************************}
begin
i := SizeStr;
Result := '';
while (Value <> 0) do
begin
Buf[i] := IntToStr(Value mod Fn);
Value := Value div Fn;
Dec(i);
end;
Result := Buf;
Delete(Result, 1, i);
DecimalToX := Result;
end;