function
TForm1
.
ots(vs:
integer
):
string
;
var
str,c,p,o,v:
string
;
nsm :
array
[
0..3
]
of
string
;
aaa :
array
[
0..2
]
of
integer
;
i,l,b,g,y :
integer
;
flg :
boolean
;
begin
str:= kvs
.
Strings[vs];
l:=
0
;
b:=
0
;
flg:=
true
;
for
i:=
1
to
Length(str)
do
begin
if
str[i] =
'='
then
begin
inc(l);
flg:=
false
;
end
;
if
flg
then
nsm[l] := nsm[l] + str[i];
if
not
flg
then
flg:=
true
;
end
;
str:= nsm[
1
] +
' '
+ nsm[
2
];
v:=
''
;
flg:=
true
;
l:=
0
;
for
i:=
1
to
Length(str)
do
begin
if
str[i] =
' '
then
flg:=
false
;
if
flg
then
v:= v + str[i];
if
not
flg
then
begin
flg:=
true
;
if
StrToIntDef(pts
.
Strings[StrToInt(v)-
1
],
0
) =
1
then
inc(l);
v:=
''
;
end
;
if
(i=length(str))
and
(v <>
''
)
then
if
StrToIntDef(pts
.
Strings[StrToInt(v)-
1
],
0
) =
1
then
inc(l);
end
;
str:= nsm[
2
];
if
length(str) >
0
then
begin
v:=
''
;
flg:=
true
;
for
i:=
1
to
Length(str)
do
begin
if
str[i] =
' '
then
flg:=
false
;
if
flg
then
v:= v + str[i];
if
not
flg
then
begin
flg:=
true
;
if
StrToIntDef(pts
.
Strings[StrToInt(v)-
1
],
0
) =
2
then
inc(l);
v:=
''
;
end
;
if
(i = length(str))
and
(v <>
''
)
then
if
StrToIntDef(pts
.
Strings[StrToInt(v)-
1
],
0
) =
2
then
inc(l);
end
;
end
;
l:= l * StrToIntDef(nsm[
3
],
0
);
if
l >
0
then
Result:= nsm[
0
] +
' - баллов: '
+ IntToStr(l)
else
Result:= nsm[
0
] +
' - баллов: нет'
;
end
;
end
.