0
0
Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
114
55
t:=0;t2:=0;dem:=0;
for i:=1 to n do
Begin
T:=t+A[I];//tong day
If a[i]<0 then
begin
t2:=t2+a[i];//t2 la tong am
dem:=dem+1;//so luong
end;
end;
Nhập xuất tự làm
Hãy giúp mọi người biết câu trả lời này thế nào?
Program FNG;
Uses crt;
Var A: array[1..1000] of longint;
n,i,s,da,sa: longint;
Begin
Clrscr;
Write('Nhap n: '); Readln(n);
s:=0; da:=0; sa:=0;
For i:=1 to n do
Begin
Write('A[',i,'] = ');
Readln(A[i]);
s:=s+A[i];
If A[i]<0 then
Begin
inc(da);
sa:=sa+A[i];
End;
End;
Writeln('S = ',s);
Writeln('Dem am = ',da)
Write('Tong am = ',sa);
Readln
End.
Hãy giúp mọi người biết câu trả lời này thế nào?
Bảng tin