878 = 1556₈
...........................
Ответ:
Ничего сложного
Объяснение:
1.
#include <iostream>
using namespace std;
int main() {
setlocale(LC_ALL, "rus");
int that = 1, index = 1, sum_index = 0, sum_element = 0;
while (that != 0) {
cin >> that;
if (that % 2 == 0) sum_element += that;
if (index % 2 == 0) sum_index += that;
index++;
}
cout << "Сумма четных элементов = " << sum_element << endl;
cout << "Сумма элементов с четными индексами = " << sum_index;
}
2.
#include <iostream>
using namespace std;
void cycle_for() {
int sum = 0;
for (int i = 50; i <= 150; i++) if (i % 4 == 0) sum += i * i;
cout << "Cycle for: " << sum << endl;
}
void cycle_while() {
int i = 50, sum = 0;
while (i <= 150) {
if (i % 4 == 0) sum += i * i;
i++;
}
cout << "Cycle while: " << sum << endl;
}
void cycle_do_while() {
int i = 50, sum = 0;
do {
if (i % 4 == 0) sum += i * i;
i++;
} while (i <= 151);
cout << "Cycle do while: " << sum;
}
int main() {
cycle_for();
cycle_while();
cycle_do_while();
}
1). 3 - это значит, что трехзначное число.
5 - сумма цифр в этом числе.
Ответ: 410
2). 8мб=2^26 бит
8мб=8192 кбайт
8192 кбайт*0.25=2048=2^24 бит
2^26/2^20=2^6=64 сек.
2^24/2^20=2^4=16 сек.
64-28=36
Ответ: А36
3). 2^2+2^3+2^4+2^5=4+8+16+32=60
Ответ: 60
B9). м=и+е+к=8+8+8=24
и=е=8
к=е=8
е=в+г+ж=1+3+4=8
в=б=1
г=б+а+д=1+1+1=3
ж=г+д=3+1=4
б=а=1
Ответ: 24
B12). Ответ: 170
B15). Очень много расписывать. Там целую таблицу составлять нужно.
B14). Честно не знаю как.
{ 1 – дециметр, 2 – километр, 3 – метр, 4 – миллиметр, 5 – сантиметр.}
var
units: integer;
value, factor: real;
begin
write('Введите значение - '); readln(value);
write('Введите единицу измерения - '); readln(units);
case units of
1: factor := 0.1;
2: factor := 1000;
3: factor := 1;
4: factor := 0.001;
5: factor := 0.01;
else
factor := 1;
end;
writeln(value * factor, ' м');
end.
Var x,y:integer;
begin
write('x = ');
readln(x);
if x>0 then y:=1
else if x=0 then y:=0 else y:=-1;
writeln('y = ',y);
end.
Пример:
x = -5
y = -1