4.
переведем все в дяситеричную систему:
39+x=85
x=46
переведем х в шестеричную систему:
Ответ:х=
5.
x=7
Ответ:х=7
#include <iostream>
#include <string>
int main()
{
using namespace std;
//1й пункт
string s1 = "Computer programming (often shortened to programming) is a process";
for (int i = 2; i < s1.size(); i = i + 3)
cout << s1[i];
cout << endl;
//2й пункт
string s2 = "Programming involves activities such as analysis, developing understanding";
for (int i = 1; i < s2.size(); i = i + 2)
if (s2[i] != 'a' && s2[i] != 'b')
s2[i] = 'a';
else
s2[i] = 'c';
cout << s2 << endl;
return 0;
}
Const n=10;
var a:array[1..n] of integer;
i,s,min:integer;
begin
Randomize;
writeln('Массив A:');
for i:=1 to n do
begin
a[i]:=random(51);
write(a[i]:3);
end;
writeln;
s:=0; min:=a[1];
for i:=1 to n do
begin
s:=s+a[i];
if a[i]<min then min:=a[i];
end;
writeln('s = ',s,' min = ',min);
end.
Пример:
Массив A:
18 22 5 50 18 23 48 2 22 26
s = 234 min = 2