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.
uses crt;
var a:array[1..100]of integer;
i,n:integer;
begin
clrscr;
write('n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
readln;
end.
uses crt;
var n,i:integer;
a:array[1..100] of integer;
begin
clrscr
write(‘nhap so phan tu cua day:’);readln(n);
for i:=1 to n do
begin
write(‘a[‘,i,’]=’);readln(a[i]);
end;
writeln(‘day so da nhap:’);
for i:=1 to n do write(a[i]:2);
readln;
end.
uses crt;
var a:array[1..100]of integer;
i,n,max:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
writeln('Day so vua nhap la: ');
for i:=1 to n do
write(a[i]:4);
writeln;
max:=a[1];
for i:=1 to n do
if max<a[i] then max:=a[i];
writeln('So lon nhat la: ',max);
readln;
end.
uses crt;
var a:array[1..100]of integer;
i,n:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
readln;
end.
uses crt;
var a:array[1..100]of integer;
i,n,h:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
h:=0;
for i:=1 to n do
if a[i] mod 2=0 then h:=h-a[i];
writeln(h);
readln;
end.
tham khảo:
uses crt;
var n,i:integer;
a:array[1..100] of integer;
begin
clrscr;
write(‘nhap so phan tu cua day:’);readln(n);
for i:=1 to n do
begin
write(‘a[‘,i,’]=’);readln(a[i]);
end;
writeln(‘day so da nhap:’);
for i:=1 to n do write(a[i]:2);
readln;
end.
uses crt;
var a:array[1..1000000] of longint;
n,i,s:longint;
begin
clrscr;
write('Nhap so luong phan tu: '); readln(n);
for i:=1 to n do
begin
write('Nhap phan tu thu ',i,': '); readln(a[i]);
if a[i] mod 2=1 then inc(s,a[i]);
end;
write('Tong cac so le: ',s);
readln;
end.
Program HOC24;
var i,n: integer;
a: array[1..1000] of integer;
t: real;
begin
write('Nhap so phan tu: '); readln(n);
for i:=1 to n do
begin
write('Nhap so thu ',i,': '); readln(a[i]);
end;
t:=0;
for i:=1 to n do t:=t+a[i];
t:=t/n;
write('Trung binh cong cua day so la: ',t:5:2);
readln
end.