var a,b,t,M,R,H :integer;
Function F(H, x: integer):integer;
begin
F := 11*(x-H)*(x-H)+13;
end;
BEGIN
readln(H);
a := 0; b := 30;
M := a; R := F(H, a);
for t := a to b do begin
if (F(H, t) > R) then begin
M := t;
R := F(H, t)
end
end;
write(M)
END.
|
#include <stdio.h>
int F(int n, int H)
{
return 11*(x-H)*(x-H)+13;
}
}
int main(void)
{
int a, b, t, M, R, H;
scanf("%d",&H);
a=0; b=30;
M=a; R=F(H,a);
for(t=a; t<=b; t++){
if ( F(H, t) > R) {
M = t;
R = F(H, t);
}
}
printf(″%d″,M);
}
|
def F(n, H):
return 11*(x - H) * (x - H) + 13
a = 0
b = 30
M = a
R = F(H, a)
for t in range (a, b+1):
if F(H, t) > R:
M = t
R = F(H, t)
print (M) |