Здесь Вы можете найти ответы на многие вопросы или задать свой вопрос!
qbasic не знаю, знаю только вижуал бэйсик
for i = 1 to 10
a(i) = i
next i
for i = 1 to 5
b = a(10+1-i)
a(10+1-i) = a(i)
a(i) = b
s = 0;
for i = a to b
if (i mod 2 =1) and (i mod 3 = 0) then
s = s + 1
end if
var s: string;
i,j,k: integer;
unique: boolean;
begin
for i : = 1000 to 9999 do
s : = str(i);
unique: =true;
for j: = 1 to length(s)-1 do
for k : = j+1 to length(s) do
if s[j] = s[k] then unique: =false;
end;
if unique then
writeln(i);
end.
может длинее, но универсальное.
varn,i: integer; x0,y0,x1,y1,x2,y2,s: real; begin readln(n); s: =0; readln(x0,y0); x1: =x0; y1: =y0; for i: =2 to n do begin readln(x2,y2); s: =s+sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); x1: =x2; y1: =y2; end; x2: =x0; y2: =y0; s: =s+sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); writeln(s: 10: 2); end.
решаем относительно a: a=(-6*x2-c)/x4=-6*x2/x4-c/x4
Популярные вопросы