viet chuong trinh tinh tong cua cac so trong doan tu 3 den 9 trong day day so nguyen nhap tu ban phim 21/07/2021 Bởi Reagan viet chuong trinh tinh tong cua cac so trong doan tu 3 den 9 trong day day so nguyen nhap tu ban phim
var a: array[1..250] of integer; S: word; i, n: byte; Begin Write(‘n = ‘); readln(n); S:=0; For i:=1 to n do Begin Write(‘a[‘, i, ‘] = ‘); readln(a[i]); if (a[i]>=3) and (a[i]<=9) then S:=S+a[i]; End; Write(‘tong la: ‘, s); Readln End. Bình luận
var a: array[1..250] of integer;
S: word;
i, n: byte;
Begin
Write(‘n = ‘); readln(n);
S:=0;
For i:=1 to n do
Begin
Write(‘a[‘, i, ‘] = ‘); readln(a[i]);
if (a[i]>=3) and (a[i]<=9) then
S:=S+a[i];
End;
Write(‘tong la: ‘, s);
Readln
End.