0
0
Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
Uses crt;
Var A:Array[1..100000] of longint;
i, n, pt: integer;
Begin
Clrscr;
Write('Nhap n = '); readln(n);
For i:=1 to n do
Begin
Write('A[',i,']=');
Readln(A[i]);
End;
pt:=0;
For i:=1 to n do if (A[i]>5) and (A[i]<10) then inc(pt,a[i]);
Writeln('Tong la: ',pt:7:2);
Readln
End.
Hãy giúp mọi người biết câu trả lời này thế nào?
Program bai_tap;
Uses crt;
Var A : array [1..150] of integer;
S,i,n: integer;
Begin
Write ('nhap n=');
Readln (n);
For i:=1 to n do
Begin
Write ('nhap phan tu thu ',i,'=');
Readln (A[i]);
end;
S:=0;
For i:=1 to n do
If (A[i]>5) and (A[i]<10) then
S:=S+A[i];
Writeln ('Tong cac phan tu lon hon 5 va nho hon 10 la:', S);
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