Var r:array[1..3,1..3] of integer;i,j,n,k,sum:integer; b:array[1..30]of integer;beginrandomize;writeln('Исходная матрица: ');for i:=1 to 3 dobeginfor j:=1 to 3 dobeginr[i,j]:=random(15)-5;write(r[i,j]:3);end;writeln;end;// cумма диагоналиwriteln;for i:=1 to 3 dobeginfor j:=1 to 3 dobeginif i=j then beginwrite(r[i,j]:3);sum:= sum + r[i,j];end elsewrite(' ':3);end;writeln;end;writeln(sum);end.
2)0.125 MB > 128KB ...................................
Ответ:
Объяснение:
Вот что получилось -2676810695814762278, не знаю как ты хочешь получить из этого ip ХD
/* 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);
}