Int main ...
int a,b,c;
cout <<" 2+2=4? 1-да, 2 - нет " << endl;
cin>>a;
if (a == 1) { <span>cout <<" Верно " << endl;}
if (a==2) </span>{ <span>cout <<" Ошибка " << endl;}
</span>cout <<" 3+2=5? 1-да, 2 - нет " << endl;
<span>cin>>a;
</span>if (a == 1) { <span>cout <<" Верно " << endl;}
if (a==2) </span>{ <span>cout <<" Ошибка " << endl;}
</span>system ("pause");
return 0;
Var a, b, c, d, e, f, final : integer;
begin
write('введите 6 чисел через пробел: ');
readln(a, b, c, d, e, f);
final := (a + b + c + d + e+ f) / 6;
writeln('среднее арифметическое равно , final);
end.
1)
Program asd;
USES crt;
Const n=10;
Var A:array[1..n] of integer;
i,kp,s:integer;
BEGIN
Writeln('Массив: ');
For i:=1 to n do
begin
A[i]:=Random(20);
Write(A[i]:4);
end;
Writeln;
For i:=1 to n do
begin
If A[i] mod 3=0 then
s:=s+1;
end;
Writeln('Сумма: ' ,s);
<span>END.
2)
Program asd;
USES crt;
Const n=10;
Var A:array[1..n] of integer;
i,kp,s:integer;
BEGIN
Writeln('Массив: ');
For i:=1 to n do
begin
A[i]:=Random(20)-10;
Write(A[i]:4);
end;
Writeln;
For i:=1 to n do
begin
If A[i]<0 then s:=s+1;
end;
If s=0 then Writeln('Нет отр. элементов!');
Writeln('Сумма отр. элементов: ' ,s);
<span>END.</span></span>
№1
#include <iostream>
using namespace std;
int main(){
int a, b;
cin>>a>>b;
for (int i=a; i<=b; ++i) if (i%3==0) cout<<i<<" ";
}
№2
#include <iostream>
using namespace std;
int main(){
int a, b, s=0;
cin>>a>>b;
for (int i=a; i<=b; ++i) if (i%2==1) s+=i;
cout<<s;
}
№3
#include <iostream>
using namespace std;
int main(){
for (int i=10; i<=20; ++i) cout<<i*i<<" ";
}