Var a,b,d,K,kp:integer; P:boolean; Begin kp:=0; ReadLn(a,b); if (a = 1)or(a = 2) then Begin kp:=2; Write(2,' ',3) end else if a = 3 then Begin kp:=1; Write(3); End; if a < 5 then a:=5 else if a mod 2 = 0 then a:=a+1; While a<=b do Begin K:=Trunc(Sqrt(A)); d:=3; P:=true; While d <= K do Begin if A mod d = 0 then P:=false; d:=d+2 End; if P then Begin kp:=kp+1; Write(' ',a); End; a:=a+2 End; if kp = 0 then Write(0) End.
#include <math.h>
using namespace std;
int main ()
{
setlocale (0,"russian");
float a,b,h,F,x;
cout << "Промежуток:\nот ";
cin >> a;
cout << "до ";
cin >> b;
cout << "Шаг: ";
cin >> h;
x=a;
do
{
F=2*tan(x/2)+1;
cout << "x=" << x << '\t' << "F(x)=" << F << endl; // \t - символ табуляции
x+=h;
if (x==0) //на ноль делить нельзя, поэтому, если x=0, то мы
x+=h; // перескакиваем к следующему аргументу
} while (x<=b);
system ("PAUSE");
return 0;
}