begin readln(n); g:=n; while n<>0 do begin g:= g div 10; k +=1; end;
for i:=1 to k do begin g:= n mod 10; sum:= sum + g; n:=n div 10; end; if sum> 10 then writeln('верно') else ('неверно'); end.
2. var n,i,k,p,h,g:integer;
begin readln(n); g:=n; while n<>0 do begin g:= g div 10; k +=1; end; p:=n mod 10; n:=n div 10; for i:=1 to k-1do begin g:= n mod 10; if g = p then h += 1; n:=n div 10; end; writeln(h); end.
3. const n=10; var
a:array[1..n]of integer; i,sum:integer;
begin a[n]:=0; for i:=1 to 9 do readln(a[i]);
for i:=1 to n do sum:=sum+a[i]; writeln(sum); end.
4. var
n:integer;
begin
readln(n);
while n<>0 do begin n:=n div 10; k += 1; end; if k = 4 then writeln('число четырехзначное') else writeln('число не четырехзначное'); end.
5. var
a:array[1..10]of integer; i:byte;
begin
for i:=1 to 10 do readln(a[i]);
for i:=1 to 10 do begin if a[i] = 2 then writeln('да есть'); break; end; end.
void TriangleArea(double a, double b, double c) { double p = (a + b + c) / 2; double ss = p * (p - a) * (p - b) * (p - c); // Using Heron's formula if (ss > 0) cout << "Area of triangle = " << sqrt(ss); else cout << "The three sides will not form a triangle."; }
cout << "\n\nThree side lengths to a triangle (a, b, c):\n"; TriangleArea(a, b, c); cout << "\n\nThree side lengths to a triangle (a, b, d):\n"; TriangleArea(a, b, d); cout << "\n\nThree side lengths to a triangle (b, c, d):\n"; TriangleArea(b, c, d); cout << "\n\nThree side lengths to a triangle (a, c, d):\n"; TriangleArea(a, c, d); cout << "\n\n"; }
var
n,i,k,sum,g:integer;
begin
readln(n);
g:=n;
while n<>0 do begin
g:= g div 10;
k +=1;
end;
for i:=1 to k do begin
g:= n mod 10;
sum:= sum + g;
n:=n div 10;
end;
if sum> 10 then
writeln('верно')
else
('неверно');
end.
2.
var
n,i,k,p,h,g:integer;
begin
readln(n);
g:=n;
while n<>0 do begin
g:= g div 10;
k +=1;
end;
p:=n mod 10;
n:=n div 10;
for i:=1 to k-1do begin
g:= n mod 10;
if g = p then
h += 1;
n:=n div 10;
end;
writeln(h);
end.
3.
const
n=10;
var
a:array[1..n]of integer;
i,sum:integer;
begin
a[n]:=0;
for i:=1 to 9 do
readln(a[i]);
for i:=1 to n do
sum:=sum+a[i];
writeln(sum);
end.
4.
var
n:integer;
begin
readln(n);
while n<>0 do begin
n:=n div 10;
k += 1;
end;
if k = 4 then
writeln('число четырехзначное')
else
writeln('число не четырехзначное');
end.
5.
var
a:array[1..10]of integer;
i:byte;
begin
for i:=1 to 10 do
readln(a[i]);
for i:=1 to 10 do begin
if a[i] = 2 then
writeln('да есть');
break;
end;
end.
using namespace std;
void TriangleArea(double a, double b, double c)
{
double p = (a + b + c) / 2;
double ss = p * (p - a) * (p - b) * (p - c); // Using Heron's formula
if (ss > 0)
cout << "Area of triangle = " << sqrt(ss);
else
cout << "The three sides will not form a triangle.";
}
void main()
{
double a, b, c, d;
cout << "a = ";
cin >> a;
cout << "b = ";
cin >> b;
cout << "c = ";
cin >> c;
cout << "d = ";
cin >> d;
cout << "\n\nThree side lengths to a triangle (a, b, c):\n";
TriangleArea(a, b, c);
cout << "\n\nThree side lengths to a triangle (a, b, d):\n";
TriangleArea(a, b, d);
cout << "\n\nThree side lengths to a triangle (b, c, d):\n";
TriangleArea(b, c, d);
cout << "\n\nThree side lengths to a triangle (a, c, d):\n";
TriangleArea(a, c, d);
cout << "\n\n";
}