Program Prog;
Uses crt;
var a: array [1..100] of real;
i, N: integer;
begin
clrscr;
Write('N = ');
readln(n);
for i:=1 to n do
begin
write('a[',i,'] = ');
readln(a[i]);
end;
writeln;
writeln('Положительные числа: ');
for i:=1 to n do
if (a[i]>0) then
writeln('a[',i,'] = ', a[i]);
end.
#include <iostream>
using namespace std;
int main()
{
int A,B,C;
cout<<"Input A: "<<endl;
cin>>A;
cout<<"Input B: "<<endl;
cin>>B;
cout<<"Input C: "<<endl;
cin>>C;
if(A>0||B>0||C>0)
cout<<"An optional item is present"<<endl;
else
cout<<"There is no additional item"<<endl;
return 0;
}
Def IsPointInCircle(x, y, xc, yc, r):
return (x-xc)*(x-xc)+(y-yc)*(y-yc)<=r*r
x = float(input())
y = float(input())
xc = float(input())
yc = float(input())
r = float(input())
if IsPointInCircle(x, y, xc, yc, r):
print("YES")
else:
print("NO")
Пример:
0.5
0.5
1
1
0.1
NO
Var
i,k,s:integer;
begin
k:=0; s:=0;
i:=7;
Writeln('Числа на интервале [7;100], кратные 7:');
while i<=100 do begin
Write(i,' ');
s:=s+i; Inc(k);
i:=i+7
end;
Writeln;
Writeln('Сумма этих чисел равна ',s,', количество равно ',k);
end.
Результат выполнения программы
Числа на интервале [7;100], кратные 7:
7 14 21 28 35 42 49 56 63 70 77 84 91 98
Сумма этих чисел равна 735, количество равно 14
1) <span>I III V VII
2) </span><span>13,5
3) 340
4) 15410</span>