-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathB14.PAS
More file actions
33 lines (33 loc) · 767 Bytes
/
B14.PAS
File metadata and controls
33 lines (33 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
program b14;
uses crt;
var
S,X:string;
p,i,j,len,pos : integer;
yes : boolean;
begin
yes := false;
clrscr;
readln(S);
for i := 1 to length(S) div 2 do
begin
X := Copy(S,1,i);
len := length(S) div i;
{writeln(len);}
for j := 1 to len do
begin
{writeln;
writeln( X[j],' ', S[j*len+1]);}
if X[j] <> S[j*len+1] then
{writeln('NO');}
break
else
begin
yes := true;
pos := i;
break;
end;
end;
end;
if yes then writeln('YES ',pos);
readln;
end.