Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
uses crt;
var a:array[1..100]of integer;
i,n,t:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
t:=0;
for i:=1 to n do
t:=t+a[i];
writeln(t);
readln;
end.
Tham khảo:
program oken;
uses crt;
var i,n:integer;
begin
clrscr;
write('nhap 1 so bat ky: '); readln(n);
writeln('BANG CUU CHUONG ',n);
for i:=1 to 9 do
writeln(n,' * ',i,' = ',n*i);
readln;
end.
Var r,s,c:real;
Begin
Write('Ban kinh = ');readln(r);
s:=3.14*r*r;
c:=2*3.14*r;
Writeln('Dien tich la ',s:10:2);
Write('Chu vi la ',c:10:2);
Readln
End.
b: uses crt;
begin
clrscr;
writeln(sqr(15+5)*sqr(6+4)*(6+4));
readln;
end.
uses crt;
var a,b,x,y:integer;
//chuongtrinhcon
function ucln(var a,b:integer):integer;
var r:integer;
begin
while b>0 do
begin
r:=a mod b;
a:=b;
b:=r;
end;
ucln:=a;
end;
//chuongtrinhchinh
begin
clrscr;
readln(a,b);
x:=a;
y:=b;
if (x>0) and (y>0) then writeln(x div ucln(a,b),' ',y div ucln(a,b));
if (x<0) and (y<0) then
begin
x:=abs(x);
y:=abs(y);
a:=abs(a);
b:=abs(b);
writeln(x div ucln(a,b),' ',y div ucln(a,b));
end;
if (x<0) and (y>0) then
begin
write('-');
x:=abs(x);
y:=abs(y);
a:=abs(a);
b:=abs(b);
writeln(x div ucln(a,b),' ',y div ucln(a,b));
end;
if (x>0) and (y<0) then
begin
write('-');
x:=abs(x);
y:=abs(y);
a:=abs(a);
b:=abs(b);
writeln(x div ucln(a,b),' ',y div ucln(a,b));
end;
readln;
end.
var i, so: integer;
begin
writeln('Nhap vao 10 so tu nhien:');
for i := 1 to 10 do
begin
write('So thu ', i, ': ');
readln(so);
writeln('So vua nhap la: ', so);
end;
readln;
end.
uses crt;
var a,b:int64;
begin
clrscr;
readln(a,b);
writeln(a*a+b*b);
readln;
end.