uses crt; procedure Prost(a:longint;var f:boolean); var i:longint; begin if a<3 then f:=false else begin f:=true; for i:=2 to round(sqrt(a)) do if a mod i=0 then f:=false; end; end; var a,b,i,k:longint; f:boolean; begin clrscr; repeat writeln('Введите диапазон натуральных чисел a<b:'); readln(a,b); until (a>=0)and(b>a); k:=0; for i:=a to b do begin Prost(i,f); if f then begin write(i,' '); k:=1; end; end; if k=0 then writeln('Простых чисел в интервале ',a,' ',b,' нет!'); readln end.
nataliaprintroll
08.01.2020
1.
var b:Integer; x,y:Real; Begin Writeln('Введите число B'); Read(b); x:=-3; if (b<10) then Writeln(2*b) else if (b>=10) then begin while(x<=1) do begin x:=x+0.1; y:=sqr(x)-x+(sin(1/b+x)/cos(1/b+x)); Writeln('При x = ',x:0:1,' y = ',y:0:2); end; end; end.
2. var n,i,sum:Integer; avarage:Real; X:Array[1..1000] of Integer; Begin Read(n); for i:=1 to n do Read(X[i]); for i:=1 to n do if (X[i]<-2) or (X[i]>2) then sum:=sum+X[i]; avarage:=sum/n; if (avarage>2) then begin X[1]:=1; X[n]:=1; end else begin X[1]:=0; X[n]:=0; end; for i:=1 to n do Write(X[i],' '); end.
3. var n,sum,i:Integer; A:Array[1..1000] of Integer; Begin Read(n); for i:=1 to n do Read(A[i]); for i:=1 to n do if (A[i]>0) and (A[i] mod 3 = 0) then sum:=sum+A[i]; for i:=n div 2 to n do A[i]:=sum; for i:=1 to n do Write(A[i],' '); end.