var a, b, t, N, P :integer;
Function F(x: integer):integer;
begin
F := 4*(5-x)*(5-x)+10;
end;
BEGIN
a := -10; b := 10;
P := 40;
N := 0;
for t := a to b do begin
if (F(t) > P) then begin
N := N+1;
end;
end;
write(N);
END.
|
#include<stdio.h>
int F(int x)
{
return(4*(5-x)*(5-x)+10);
}
int main(void)
{
int a, b, t, P, N;
a = -10; b = 10;
P = 40;
N = 0;
for (t=a; t<= b; t++)
if (F(t) > P) N = N+1;
printf(″%d″, N);
}
|
def F(x):
return 4*(5 - x) * (5 - x) + 10
a = -10
b = 10
P = 40
N = 0
for t in range (a, b+1):
if F(t) > P:
N +=1
print (N) |