## Posted By

kvaso on 06/01/10

# ujo fero

/ Published in: Pascal

`uses {uTEST,} crt;var K, N, A, B, C, M, P, Z, i,j,ii,jj : longint;var prvaCifra, druhaCifra,pocet,code:integer;var s:real;var pom:string;  begin  clrscr;  {0}  gotoxy(2,2); write( 'Kpt. ujo Fero je tu!');  assign(input,'VSTUP.in'); reset(input);  read(K,N,A,B,C,M,P,Z);  {a}  gotoxy(2,4); write('Kubkov panelak ma 5 poschodi.');  gotoxy(2,5); write('Matkov panelak ma ',k*2-1,' poschodi.');  {b}  gotoxy(2,7); write('IAIA: ');  str(n,pom);  prvaCifra := ord(pom[1])-48;  druhaCifra := ord(pom[2])-48;  druhaCifra := druhaCifra + 1;  for i:=1 to 5 do begin    write(prvaCifra,druhaCifra,prvaCifra,druhaCifra,' ');    druhaCifra:=druhaCifra+1;    if (druhaCifra > 9) then begin      druhaCifra := 0;      prvaCifra := prvaCifra + 1;    end;  end;  {c}  gotoxy(2,9); write('3u: A=',A,'  B=',B,'  C=',C);  if (a+b>c) and (a+c>b) and (b+c>a) then write(' sa da.')  else write(' sa neda.');  gotoxy(2,10); write('Obvod:  ',a+b+c);  s := (a+b+c)/2;  gotoxy(2,11); write('Plocha: ',sqrt(s*(s-a)*(s-b)*(s-c)):0:1);  {d}  {uff no s tymto boli problemy - urcote sa to da cez nejaku matiky, ale  z tohto vztahu som nevedel vyjadrit X: sqrt(b+x)-sqrt(a+x)=sqrt(c+x)-sqrt(b+x)  takze nakoniec som to urobil britalnou silou :D  }   gotoxy(2,12);  i := 0;  while true do begin    if (frac(sqrt(a+i))=0.0) and (frac(sqrt(b+i))=0.0) and (frac(sqrt(c+i))=0.0) then begin      {ak su odmocniny cele cisla}      if sqrt(b+i)-sqrt(a+i)=sqrt(c+i)-sqrt(b+i) then break; //nasiel som vysledok    end;    i := i + 1;  end;  write(A,'+',i,'=',round(sqrt(A+i)),'^2 ');  write(B,'+',i,'=',round(sqrt(B+i)),'^2 ');  write(C,'+',i,'=',round(sqrt(C+i)),'^2');end.`