Первое:
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;
var Age : integer; {Возраст}
Sex : char; {Пол}|
Stag: integer; {Стаж}
Flag: boolean; {Логическое ДА или НЕТ}
begin
WriteLn('Age='); ReadLn(Age);
WriteLn('Sex='); ReadLn (Sex);
WriteLn('Stag='); ReadLn(Stag);
Flag:=false;
If (Sex='M') and (Age>=55) and (Stag>=15) then Flag:=true;
if (Sex='F') and (Age>=50) and (Stag>=15) then Flag:=true;
If (Flag=true) then WriteLn('НА ПЕНСИИ') else Writeln('ЕЩЕ РАБОТАЕТ');
ReadLn;
end.
#include<iostream>
int main()
{
int a=0;int b= 0;int c =0;
cin<<a<<b;
c=a*b;
cout<<c;
}
1. (A ∧ ¬B) ∨ (¬A ∧ B)
1. ( (A ∧ ¬B) ∨ ¬A) ∧ ( (A ∧ ¬B) ∨ B) - <em>по закону дистрибутивности</em>;
2. ( (A ∨ ¬A) ∧ (¬B ∨ A) ) ∧ ( (B ∨ A) ∧ (¬B ∨ B) - <em>по закону дистрибутивности</em>;
3. (1 ∧ (¬B ∨ A)) ∧ ( (B ∨ A) ∧ 1) - <em>по закону исключения третьего</em>;
4. (¬B ∨ A) ∧ (B ∨ A) = A - <em>по закону исключения (склеивания)</em>.
2. ¬(A ∨ ¬B)
¬(A ∨ ¬B) = ¬A ∧ B - <em>по закону де Моргана</em>.
3. A ∧ ¬B ∨ C
A ∧ ¬B ∨ C = (C ∨ A) ∧ (C ∧ ¬B) - <em>по закону дистрибутивности</em>.