#include <iostream>
#include <conio.h>
float mathFunc(float x) {
if (x < 0)
return 2 * x;
else if (x > 0)
return x * x + 10;
return 0;
}
int main() {
setlocale(LC_ALL, "");
std::cout << mathFunc(-1) << " " << mathFunc(0) << " " << mathFunc(1);//проверка
_getch();
return 0;
<span>}
//1
</span>#include <iostream>
#include <conio.h>
int main() {
setlocale(LC_ALL, "");
int year;
while (true) {
system("cls");
std::cout << "Введите год своего рождения:";
std::cin >> year;//год может быть отрицательным => до н.э.
year = 2017 - year;
printf("Вам %d лет,", year);
if (year < 45)
printf("вы молоды");
else if (year < 60)
printf("вы среднего возраста");
else if (year < 75)
printf("вы пожилого возраста");
else if (year > 90)
printf("вы старческого возраста");
<span>_getch();
</span><span>return 0;
}
//2
</span>
Проаскот кавнотаг маего вцпилзп рарлщ.
Dim x As Integer
Dim y As Integer
Sub zadacha()
x = InputBox("vvedi x", "VVod dannyh", 11)
If x <= 10 Then y = 210 Else y = x * x * x
MsgBox ("pri x=" + CStr(x) + " y=" + CStr(y))
End Sub<span>
</span>
2 0 1 0 0
3 0 1 0 0
4 0 1 0 0
5 0 1 0 0
6 0 1 1 1
Var a, k1, k2:integer;
Begin
K1:=0;k2:=0;a:=1;
While a<>0 do begin
Write('a=') ;read(a) ;
If a mod 2 =0 then k1:=k1+1 Else k2:=k2+1;
End;
Write ('четных ', k1-1) ;
Write('нечетных ', k2) ;
End.