2-ое задание:
#include <iostream>
int main() {
int number;
std::cout << "Введите число: " << std::endl;
std::cin >> number;
if (number > 0)
std::cout << "Положительное" <<std::endl;
else if (number < 0)
std::cout << "Отрицательное" << std::endl;
else
std::cout << "Ноль" << std::endl;
return 0;
}
1-ое задание:
#include <iostream>
int main() {
double dollars, grivnas;
std::cout << "Введите кол-во долларов: " << std::endl;
std::cin >> dollars;
grivnas = dollars * 28.3;
std::cout << dollars << " доллар-(а, ов) в гривнах " << grivnas << std::endl;
return 0;
}
Объяснение:
var a,b,c: Integer;
begin
a:=20;
b:=6;
b:=a-3*b;
if a>b then c:=a+2*b else c:=b+2*a;
writeln(c);
end.
2. c = 24