<script type="text/javascript">
var eu=71.3805321;
var dol=64.4205373;
var rub=prompt('Enter value in ruble:','rub');
alert('$:'+rub/dol+' eu:'+rub/eu);
<span> </script></span>
Const n=15;
var a:array[1..n] of integer;
i,k,max:integer;
begin
Randomize;
writeln('Массив A:');
for i:=1 to n do
begin
a[i]:=random(33)-15;
write(a[i]:4);
end;
writeln;
k:=0;
max:=-999;
for i:=1 to n do
begin
if a[i] mod 2 = 0 then k:=k+1;
if (a[i]>max)and(a[i]<0) then max:=a[i];
end;
writeln('k = ',k,' max = ',max);
end.
Пример:
Массив A:
14 5 5 7 -10 -13 -3 10 5 -2 -4 -5 3 -10 -14
k = 7 max = -2
Первое:
var cookie = 25, milk = 10, coffee = 3; var count_cookie = 0.5, count_milk = 2, count_coffee = 5; var money = 50;
function ТчкЗпт(ч) { return String(ч).replace(".",","); }
document.write("Печенье в клеточку: " + cookie + " грн * " + ТчкЗпт(count_cookie) + " = " + ТчкЗпт(cookie * count_cookie) + "<br />");
document.write("Молоко бычье: " + milk + " грн * " + ТчкЗпт(count_milk) + " = " + ТчкЗпт(milk * count_milk) + "<br />");
document.write("Кофе: " + coffee + " грн * " + ТчкЗпт(count_coffee) + " = " + ТчкЗпт(coffee * count_coffee) + "<br /><br />");
document.write("Наличка: " + money + "<br />");document.write("Сдача: " + (money - cookie * count_cookie - milk * count_milk - coffee * count_coffee));
Второе:
var a=85;
var n1=a%10;
var n2= (a - n1) / 10;
var a=851;
var n1=a % 10;
var n2= (a % 100 - n1) / 10;
var n3= (a - n2 * 10 - n1) / 100;
var a=8511;
var n1=a % 10;
var n2= (a % 100 - n1) / 10;
var n3= (a % 1000 - n2 * 10 - n1) / 100;
var n4= (a - n3 * 100 - n2 * 10 - n1) / 1000;