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.
Program bt_3;
Uses crt;
Var a: array[1..100] of integer;
Dem, Tong, n, i: integer;
Begin
Clrscr;
Writeln(‘nhap so phan tu, n=’);
Readln (n);
for i := 1 to n do
begin
writeln(‘nhap gia trij phan tu thu ’,i,’ =’);
readln(a[i]);
end;
Dem:=0;
Tong:=0;
For i:=1 to n do
If (a[i] mod 2 = 0) and (a[i] mod 3 = 0) then
begin
Dem:= Dem+1;
Tong:= Tong+a[i];
end;
writeln(‘Dem la:’,Dem);
Writeln(‘Tong la:’,Tong);
Readln
End.
Program bt_3;
Uses crt;
Var a: array[1..100] of integer;
Dem, Tong, n, i: integer;
Begin
Clrscr;
Writeln(‘nhap so phan tu, n=’);
Readln (n);
for i := 1 to n do
begin
writeln(‘nhap gia trij phan tu thu ’,i,’ =’);
readln(a[i]);
end;
Dem:=0;
Tong:=0;
For i:=1 to n do
If (a[i] mod 2 = 0) and (a[i] mod 5 = 0) then
begin
Dem:= Dem+1;
Tong:= Tong+a[i];
end;
writeln(‘Dem la:’,Dem);
Writeln(‘Tong la:’,Tong);
Readln
End.
Program bt_3;
Uses crt;
Var a: array[1..100] of integer;
Dem, Tong, n, i: integer;
Begin
Clrscr;
Writeln(‘nhap so phan tu, n=’);
Readln (n);
for i := 1 to n do
begin
writeln(‘nhap gia trij phan tu thu ’,i,’ =’);
readln(a[i]);
end;
Dem:=0;
Tong:=0;
For i:=1 to n do
If (a[i] mod 2 = 1) and (a[i] mod 3 = 0) then
begin
Dem:= Dem+1;
Tong:= Tong+a[i];
end;
writeln(‘Dem la:’,Dem);
Writeln(‘Tong la:’,Tong);
Readln
End.
Program bt_3;
Uses crt;
Var a: array[1..100] of integer;
Dem, Tong, n, i: integer;
Begin
Clrscr;
Writeln(‘nhap so phan tu, n=’);
Readln (n);
for i := 1 to n do
begin
writeln(‘nhap gia trij phan tu thu ’,i,’ =’);
readln(a[i]);
end;
Dem:=0;
Tong:=0;
For i:=1 to n do
If (a[i] mod 2 = 1) and (a[i] mod 5 = 0) then
begin
Dem:= Dem+1;
Tong:= Tong+a[i];
end;
writeln(‘Dem la:’,Dem);
Writeln(‘Tong la:’,Tong);
Readln
End.
uses crt;
var a:array[1..200]of integer;
n,i,k,t,t1:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
write('Nhap k='); readln(k);
t:=0;
for i:=1 to n do
if a[i] mod 2<>0 then t:=t+a[i];
t1:=0;
for i:=1 to n do
if a[i] mod k=0 then t1:=t1+a[i];
writeln('Tong cac phan tu le la: ',t);
writeln('Tong cac phan tu la boi cua ',k,' la: ',t1);
readln;
end.
var a:array[1..100] of integer;
i,n,S,d:byte;
begin
write(' n = '); readln(n);
for i:=1 to n do begin
write('A[',i,'] = ');
readln(A[i]);
end;
d:=0; S:=0;
for i:=1 to n do if A[i] mod 2 = 0 then begin
d:=d+1;
S:=S+A[i];
end;
write('Dãy có ',d,' phần tử là số chẵn và tổng của chúng là : S = ',S);
readln
end.
uses crt;
var a:array[1..100]of integer;
n,i,k,dem,dem1:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
write('Nhap k='); readln(k);
dem:=0;
dem1:=0;
for i:=1 to n do
begin
if a[i] mod 2=0 then inc(dem);
if a[i] mod k=0 then inc(dem1);
end;
writeln('So phan tu chan la: ',dem);
writeln('So phan tu chia het cho ',k,' la: ',dem1);
readln;
end.
uses crt;
var b:array[1..400]of integer;
i,m,dem:integer;
begin
clrscr;
write('Nhap m='); readln(m);
for i:=1 to m do
begin
write('B[',i,']='); readln(b[i]);
end;
dem:=0;
for i:=1 to m do
if b[i] mod 2<>0 then inc(dem);
writeln(dem);
readln;
end.
6:
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,A[100],i,dem=0;
cin>>n;
for (int i=1; i<=n; i++) cin>>A[i];
for (int i=1;i<=n; i++)
if (A[i]%2!=0) dem++;
cout<<dem;
return 0;
}
5:
#include <bits/stdc++.h>
using namespace std;
int main()
{
long long n,nn=1e6,A[1000];
cin>>n;
for (int i=1; i<=n; i++) cin>>A[i];
for (int i=1; i<=n; i++)
nn=min(nn,A[i]);
for (int i=1; i<=n; i++)
if (nn==A[i]) cout<<i<<" ";
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long x,n,i,t,dem;
int main()
{
cin>>n;
dem=0;
t=0;
for (i=1; i<=n; i++)
{
cin>>x;
if (x%2==0 && x>10) t+=x;
if (x%2!=0 || x<100) dem++;
}
cout<<t<<" "<<dem;
return 0;
}