/* 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);
}
Python 3
a = int(input())
b = int(input())
print(*list(range(a, b + 1)))
label nach;
uses crt;
var x,s:integer;
begin
s:=0;
repeat
nach:
write('vvedite x=');read(x);
if (x!=0) then begin writeln(x); s:=s+x; goto nach;end else s:=s+x;
until (x=0);
writeln('summa ravna=',s);
end.
Var a,b,c,i,n: integer;
begin
write('n = ');
readln(n);
a := 0;
write(a,' '); b := 1; write(b,' ');
for i:=3 to n do begin
write(a+b,' ');
c := b;
b := a + b;
a := c
end;<span>end.</span>