All pastes #41277 Raw Edit

Mine

public text v1 · immutable
#41277 ·published 2006-02-12 15:34 UTC
rendered paste body
program domui;
var skc:integer;

function kvd(skc:integer):integer;
var a,b,c:integer;
begin
a:=skc div 100;
b:=(skc-a*100) div 10;
c:=(skc-a*100-b*10);

skc:=sqr(c);
if skc>9 then skc:=skc+sqr(b)*100
else skc:=skc+sqr(b)*10;

if (c>3) and (b>3) then skc:=skc+sqr(a)*10000;
if (c<=3) and (b>3) or (c>3) and (b<=3) then skc:=skc+sqr(a)*1000;
if (c<=3) and (b<=3) then skc:=skc+sqr(a)*100;
kvd:=skc;
end;

begin
writeln('iveskite trizenkli skc: ');
readln(skc);
writeln(kvd(skc));
end.