Овде следуваат решенијата на задачите во Паскал:

### Часовник#

```program casovnik;
var
k,a,b,i,n,z,j:integer;
begin
i:=(60*a)+b;
j:= (60*n)+z;
if j<i then j:=j+(24*60);
k:=j-i;
i:=k div 60;
j:=k mod 60;
if (i<10) and (j<10) then writeln('0',i,':','0',j)
else if i<10 then writeln('0',i,':',j)
else if j<10 then writeln(i,':','0',j)
else writeln(i,':',j);
end.
{(c)Jovan Bidikov}
```

### Торта#

```program torta;
var
a,b:array [1..100] of integer;
p,n,k,zbir,i,j:integer;
begin
zbir := 0;
for i:= 1 to k do
begin
end;
for i:=1 to k-1 do
begin
for j:=i+1 to k do
if a[i]>a[j] then
begin
p:=a[i];
a[i]:=a[j];
a[j]:=p;
end;
end;
for i:=1 to k-1 do
begin
for j:=i+1 to k do
if b[i]>b[j] then
begin
p:=b[i];
b[i]:=b[j];
b[j]:=p;
end;
end;
repeat
begin
if n >= 6 then
begin
if a[1]<= (b[1]*6) then
begin
zbir:= zbir + a[1];
n:=n - 6;
end;
if a[1] > (b[1]*6) then
begin
zbir:= zbir + (b[1]*6);
n:=n-6;
end;
end;
if n< 6 then
begin
if (b[1]*n) <= a[1] then
begin
zbir :=zbir +  (b[1]*n);
n:=0;
end
else
begin
zbir:= zbir + a[1];
n:=0;
end;
end;
end;
until (n<=0);
writeln(zbir);
end.
{(c) Jovan Bidikov}
```

### Потоци#

```program potoci;
var
a,b,c,d:array [1..1200] of longint;
n,i,j,m,v:integer;
begin
a[1]:=1;
b[1]:=3;
c[1]:=9;
d[1]:=n;
for i:=2 to 1200 do
begin
a[i]:=a[i-1]+(a[i-1]mod 10)+(a[i-1]div 10 mod 10)+(a[i-1]div 100 mod 10)+(a[i-1]div 1000 mod 10)+(a[i-1]div 10000 mod 10);
b[i]:=b[i-1]+(b[i-1]mod 10)+(b[i-1]div 10 mod 10)+(b[i-1]div 100 mod 10)+(b[i-1]div 1000 mod 10)+(b[i-1]div 10000 mod 10);
c[i]:=c[i-1]+(c[i-1]mod 10)+(c[i-1]div 10 mod 10)+(c[i-1]div 100 mod 10)+(c[i-1]div 1000 mod 10)+(c[i-1]div 10000 mod 10);
d[i]:=d[i-1]+(d[i-1]mod 10)+(d[i-1]div 10 mod 10)+(d[i-1]div 100 mod 10)+(d[i-1]div 1000 mod 10)+(d[i-1]div 10000 mod 10);
end;
for i:=1 to 1200 do
begin
for j:=1 to 1200 do
if d[i]=a[j] then
begin
if (m=0) or (a[j]<m) then
begin
m:=a[j];
v:= 1;
end;
end;
for j:=1 to 1200 do
if d[i]=b[j] then
begin
if (b[j]< m) or (m=0) then
begin
m:=b[j];
v:= 3;
end;
end;
for j:=1 to 1200 do
if d[i]=c[j] then
begin
if (c[j] < m)or (m=0) then
begin
m:= c[j];
v:=9;
end;
end;
end;
writeln(v,' ',m);
end.
{(c) Jovan Bidikov}
```

### Кастрење#

```program kastrenje;
label 1,2;
var n,k,poz,i,j:integer;
tr:boolean;
zborovi:array[1..50] of string;
pom,del:string;
begin
for k:=1 to n do readln(zborovi[k]);
for k:=1 to n do begin
poz:=1;
tr:=false;
pom:='';
while tr=false do begin
pom:=pom+zborovi[k][poz];
tr:=true;
for i:=1 to n do begin
if (i<>k) then begin
del:='';
if poz>length(zborovi[i]) then begin
goto 2;
end
else begin
for j:=1 to poz do del:=del+zborovi[i][j];
if del=pom then begin
tr:=false;
goto 1;
end;
end;
end;
2:
end;
1:if tr=false then poz:=poz+1;
end;
writeln(pom);
end;
end.

```

Кој ги има другите решенија во паскал, нека ги стави :)

Only authorized users are allowed to upload new attachments.
« This page (revision-3) was last changed on 20-Aug-2015 17:35 by MarioTalevski
G’day (anonymous guest)
Материјали:

Натпревари 2013:

Натпревари 2012:

Натпревари 2011:

Натпревари 2010:

Системски:

JSPWiki v2.8.3