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..6] of integer;
I,t:integer,
Begin
Clrscr;
For i:=1 to 6 do
Begin
Write('a[',i,']='); readln(a[i]);
End,
T:=0;
For i:=1 to 6 do
If (a[i] mod 3=0) and (a[i] mod 5=0) then t:=t+a[i];
Writeln(t);
Readln;
End.
Câu 1:
uses crt;
var a:array[1..5]of integer;
max,i:integer;
begin
clrscr;
for i:=1 to 5 do
begin
write('A[',i,']='); readln(a[i]);
end;
max:=a[1];
for i:=1 to 5 do
if max<a[i] then max:=a[i];
writeln(max);
readln;
end.
Câu 2:
uses crt;
var a:array[1..6]of integer;
min,i:integer;
begin
clrscr;
for i:=1 to 6 do
begin
write('A[',i,']='); readln(a[i]);
end;
min:=a[1];
for i:=1 to 6 do
if min>a[i] then min:=a[i];
writeln(min);
readln;
end.
Câu 1:
uses crt;
var a:array[1..200]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
if a[i] mod 2=0 then t:=t+a[i];
writeln(t);
readln;
end.
Program Tin;
Uses crt;
Var i,n:integer;
A:array[1..1000] of integer;
Begin
Clrscr;
Write('Nhap n: ');readln(n);
Writeln('Nhap ',n,' phan tu: ');
For i:= 1 to n do
Begin
Write('A[',i,'] = ');
Readln(A[i]);
End;
Writeln('Cac phan tu chia het cho 5:');
For i:=1 to n do If A[i] mod 5 = 0 then write(A[i],' ');
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;
for i:=1 to n do
if a[i] mod 5=0 then write(a[i]:4);
readln;
end.
Uses crt;
Var a:array[1..6] of integer;
I,s:integer;
Begin
Clrscr;
For i:=1 to 6 do
Begin
Write('a[',i,']='); readln(a[i]);
End;
S:=1;
For i:=1 to 6 do
If a[i] mod 3=0 then s:=s*a[i];
Writeln(s);
Readln;
End.
#include <bits/stdc++.h>
using namespace std;
long long a[1000],i,n,t;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
for (i=1; i<=n; i++) cout<<a[i]<<" ";
cout<<endl;
t=0;
for (i=1; i<=n; i++) t+=a[i];
cout<<t;
return 0;
}
Program HOC24;
var a: array[1..15] of integer;
i: byte;
t: longint;
begin
for i:=1 to 15 do
begin
write('Nhap phan tu thu ',i,': '); readln(a[i]);
end;
t:=0;
write('Cac so chia het cho 5 la: ');
for i:=1 to 15 do if a[i] mod 5=0 then
begin
write(a[i].' ');
t:=t+a[i];
end;
writeln;
write('Tong cac so chia het cho 5 la: ',t);
readln
end.