Это глубина цвета, ещё её по другому называют весом пикселя.
До перелива 8 0 0
1) 3 5 0
2) 3 2 3
3) 6 2 0
4) 6 0 2
5) 1 5 2
6) 1 4 3
<span>7) 4 4 0</span>
Var
i, x, sum, n: integer;
begin
read(n);
for i:=1 to n do begin read(x); if x mod 2=0 then sum:=sum+x end;
writeln(sum);
end.
Program spusku;
uses crt;
type
spusok=^elem;
elem=record
data:integer;
next:spusok;
end;
var i:spusok;
procedure add(var current:spusok; elem:integer);
var x:spisok;
begin
new(x);
x^.data:=elem;
x^.next:=nil;
current^.next:=x;
current:=x;
end;
procedure stvor(var i:spusok);
var p:spisok; n:integer;
begin
i:=nil;
writeln('Vvedite spusok celux 4usel. 0-konec');
readln(n);
add(i,n);
readln(n);
while n<>0 do
begin
p:=i;
while p^.next<>nil do
p:=p^.next;
add(p,n);
readln(n);
end;
end;
procedure minmax(var i:spusok);
var p:spusok; kmin, kmax:integer;
begin
kmin:=1000000;
kmax:=0;
while i<>nil do
begin
p:=i;
if p^.data>kmax then kmax:=p^.data;
if p^.data<kmin then kmin:=p^.data;
i:=i^.next;
end;
writeln('raznost =', kmax-kmin)
end;
BEGIN
clrscr;
stvor(i);
minmax(i);
readkey;
end.
#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;
}