Var
S, X, a, b, R: Real;
C: String;
Begin
WriteLn('Chto budem vichislat');
ReadLn(C);
if C = 'O' then begin
WriteLn('Radius');
ReadLn(R);
S:= Pi*sqr(R);
end;
if C:= 'T' then begin
WriteLn('Vvedite 1 katet);
ReadLn(a);
WriteLn('Vvedite 2 katet);
ReadLn(b);
S:= 1/2 * a * b;
end;
if C:= 'K' then begin
WriteLn('Vvedite 1 katet);
ReadLn(a);
S:= sqr(a);
end;
WriteLn('Ploshad = ');
ReadLn(S);
end.
#include <stdlib.h>
#include <time.h>
#include <iostream>
using namespace std;
#define N 16
void main()
{
int randomNumbers[N];
srand(time(NULL));
for (int i = 0;i < N; i++)
{
randomNumbers[i] = rand() % 40 - 20;
cout << "randomNumber[" << i << "] = " << randomNumbers[i] << endl;
}
cout << endl;
int counter = 0;
for (int i = 0; i < N; i++)
{
if (randomNumbers[i] < 0)
{
counter++;
}
}
cout << "counter = " << counter << endl;
}