#include < iostream> #include < string> #include < windows.h> int main() { setconsolecp(1251); setconsoleoutputcp(1251); std: : string x, y; std: : cin > > x > > y; //1 bool same= false; for (auto i : x){ for (auto j : y){ if (i == j) {same = true; break; } } if (same) break; } std: : cout < < std: : boolalpha < < same; //2 for (unsigned int i = 0; i < x.size(); ++i) if (x[i] == 'а' || x[i] == 'б') x.insert(x.begin() + i, x[i]); std: : cout < < x; return 0; }
AndreiAstakhva1442
23.02.2022
Const n=30; var a: array[1..n] of integer; i,min,max,s: integer; sr: real; begin randomize; writeln('массив a: '); for i: =1 to n do begin a[i]: =random(11)+10; write(a[i]: 6); end; writeln; min: =a[1]; max: =a[1]; s: =a[1]; for i: =2 to n do begin if a[i]< min then min: =a[i]; if a[i]> max then max: =a[i]; s: =s+a[i]; end; sr: =s/n; writeln('min = ',min,' max = ',max,' sr = ',sr); s: =0; for i: =1 to n do write(a[i]-sr: 6: 1); end. пример (для 10 дней): массив a: 11 16 19 15 13 19 11 16 17 17 min = 11 max = 19 sr = 15.4 -4.4 0.6 3.6 -0.4 -2.4 3.6 -4.4 0.6 1.6 1.6
denisdenisov63
23.02.2022
Программа #include < iostream> using namespace std; int main() { int a, z, n; cout < < "a = "; cin > > a; cout < < "z = "; cin > > z; cout < < "n = "; cin > > n; cout < < (a + z) * n / 2; return 0; } пример работы программы: a = 1 z = 9 n = 5 s = 25