Var s: int64;begins:=1;for var i:=10 to 20 dos:=s * i;write(s);end.
Через 30 років.
10+30=40
50+30=80
80 більше за 40 в 2 рази
В эфиопии ученые обнаружили человека которому 160 тыс.лет. Они полагают,что примерно 200 лет назад появился человек разумный.
const
handsfree = false;
nmax = 31;
random_min = -20;
random_max = 30;
var
a: array[1..nmax] of real;
i, n, j: integer;
k: integer;
begin
{ввод массива}
if handsfree then
n := random(nmax - 5) + 5
else begin
write('n = ');
readln(n);
end;
writeln('Данные массива:');
for i := 1 to n do
begin
if handsfree then begin
a[i] := random(random_max - random_min) + random_min;
write(a[i], ' ');
end
else
readln(a[i]);
end;
writeln();
{подсчет элементов}
k := 0;
for i := 1 to n do
if a[i] = 15 then
k := k + 1;
writeln('quantity = ', k);
end.
/* 1 */
#include <stdio.h>
struct Point {
double x, y;
};
struct Point fillPoint(unsigned short int id) {
struct Point p;
printf("Точка №%d\n", id);
printf("x = ");
scanf("%lf", &(p.x));
printf("y = ");
scanf("%lf", &(p.y));
return p;
}
int pointsInSameQuarter(struct Point p1, struct Point p2) {
if ( ( (p1.x > 0) && (p2.x > 0) ) || ( (p1.x < 0) && (p2.x < 0) ) ) { /* xs */
if ( ( (p1.y > 0) && (p2.y > 0) ) || ( (p1.y < 0) && (p2.y < 0) ) ) { /* ys */
return 1;
}
}
return 0;
}
int main() {
struct Point p1 = fillPoint(1), p2 = fillPoint(2);
printf("Точки %sв одной координатной четверти", (pointsInSameQuarter(p1, p2) ? "" : "не "));
}
/* 2 */
#include <stdio.h>
#include <math.h>
int main() {
int x;
printf("x = ");
scanf("%d", &x);
float r;
int c = 0;
for (int d = 1; d <= x; d++) {
r = (float) x / d;
if ( ceilf(r) == r ) c++;
}
printf("Ответ: %d", c);
}