int main() { float x1, xn, h; float a = 4, b = 7; printf("Введите x1, xn, h:\n"); scanf("%f",&x1); scanf("%f",&xn); scanf("%f",&h); for (float x=x1; x<=xn; x +=h) printf("x = %.2f y = %.5f\n",x,b*x*sqrt(1+log(x))); return 0; }
2. #include <stdio.h> #include <math.h>
int main() { float x1, xn, h, x; float a = 4, b = 7; printf("Введите x1, xn, h:\n"); scanf("%f",&x1); scanf("%f",&xn); scanf("%f",&h); x = x1; while (x<=xn){ printf("x = %.2f y = %.5f\n",x,b*x*sqrt(1+log(x))); x += h; } return 0; }
3. #include <stdio.h> #include <math.h>
int main() { float x1, xn, h, x; float a = 4, b = 7; printf("Введите x1, xn, h:\n"); scanf("%f",&x1); scanf("%f",&xn); scanf("%f",&h); x = x1; do { printf("x = %.2f y = %.5f\n",x,b*x*sqrt(1+log(x))); x += h; } while (x<=xn); return 0; }
Пример: <span>Введите x1, xn, h: 2 5 0.1 x = 2.00 y = 18.21694 x = 2.10 y = 19.40142 x = 2.20 y = 20.59491 ... x = 4.90 y = 55.19244 x = 5.00 y = 56.53810</span>
Var skorost,pyt:real; begin writeln('Скорость равна = '); read(skorost); writeln('Путь равен = '); read(pyt); writeln('Время равно = ',pyt/skorost); end.
Var a:array[1..10] of integer; i,count:integer; begin for i:=1 to 10 do begin a[i]:=1+random(10); write(a[i],' '); end; count:=0; for i:=1 to 10 do begin if a[i]=1 then count:=count+1; end; writeln('Кол-во элементов равных единице=', count); end.