Pagini recente » Cod sursa (job #1584022) | Cod sursa (job #2281090) | Cod sursa (job #1625660) | Cod sursa (job #2099585) | Cod sursa (job #363477)
Cod sursa(job #363477)
program loto;
var bagate,solutie:array[0..100]of longint;
i,x,y,n,castig:longint;
f:text;
b,ok:boolean;
begin
assign(f,'loto.in'); reset(f);
readln(f,n);
for i:=1 to n do read(f,bagate[i]);
readln(f);
for i:=1 to 6 do read(f,solutie[i]);
close(f);
assign(f,'loto.out'); rewrite(f);
x:=0;
y:=3;
while y<=n do begin
inc(x);
inc(y);
ok:=false;
for i:=x to y do
if solutie[i-x+1]<>bagate[i] then ok:=true;
if ok=false then castig:=4;
ok:=false;
for i:=x to y do
if solutie[i-x+2]<>bagate[i] then ok:=true;
if ok=false then castig:=4;
ok:=false;
for i:=x to y do
if solutie[i-x+3]<>bagate[i] then ok:=true;
if ok=false then castig:=4;
end;
x:=0;
y:=4;
while y<=n do begin
inc(x);
inc(y);
ok:=false;
for i:=x to y do
if solutie[i-x+1]<>bagate[i] then ok:=true;
if ok=false then castig:=5;
ok:=false;
for i:=x to y do
if solutie[i-x+2]<>bagate[i] then ok:=true;
if ok=false then castig:=5;
end;
x:=0;
y:=5;
while y<=n do begin
inc(x);
inc(y);
ok:=false;
for i:=x to y do
if solutie[i-x+1]<>bagate[i] then ok:=true;
if ok=false then castig:=6;
end;
writeln(f,'castig cu ',castig,' numere');
close(f);
end.