Var ars:array[1..50] of string; ark:array[1..50] of integer; s:string; i,n,k,j:integer; begin readln(n); k:=0; for i:=1 to n do begin; readln(ars[i]); for j:=1 to 4 do delete(ars[i],1,pos(' ',ars[i])); s:=ars[i]; if (s[1]='6') or (s[1]='7') or (s[1]='8') then begin; inc(k); ark[k]:=i; end; end; writeln(k); for i:=1 to k do writeln(ark[i]); end.
Пример ввода: 2 Петров Петр Петрович 10 6 2007 Иванов Иван Иванович 10 2 2007 Пример вывода: 1 1
(1) A
(2) AAB
(3) AABAABC
(4) AABAABCAABAABCD
(5)
(6)
(7)
(8)
AABAABCAABAABCDEFGH
(9)
A
(10)
A
class Number2
{
String[] Str_ = new String[30];
const string Alphabet = "";
public void Solve()
{
for (int i = 0; i < 10; i++)
{
if (i == 0)
{
Str_[i] += Alphabet[i];
}
else
{
Str_[i] = Str_[i - 1] + Str_[i - 1] + Alphabet[i];
}
Console.WriteLine("({0}) {1}", i + 1, Str_[i]);
if (Str_[i].Length >= 256)
{
Console.WriteLine("{0}",Str_[i][256 - 1]);
}
}
}
}
Var
ars:array[1..50] of string;
ark:array[1..50] of integer;
s:string;
i,n,k,j:integer;
begin
readln(n);
k:=0;
for i:=1 to n do
begin;
readln(ars[i]);
for j:=1 to 4 do
delete(ars[i],1,pos(' ',ars[i]));
s:=ars[i];
if (s[1]='6') or (s[1]='7') or (s[1]='8') then
begin;
inc(k);
ark[k]:=i;
end;
end;
writeln(k);
for i:=1 to k do
writeln(ark[i]);
end.
Пример ввода:
2
Петров Петр Петрович 10 6 2007
Иванов Иван Иванович 10 2 2007
Пример вывода:
1
1