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 i,n,n,d: integer;
t: longint;
A: array[1..32000] of integer;
begin
clrscr;
readln(n);
for i:=1 to n do
readln(a[i]);
for i:=1 to n do
if a[i] >0 then
begin
d:=d+1;
t:=t+a[i];
end;
writeln('Tong la:',t);
write('Co tat ca so so duong la:',d);
readln;
end.
uses crt;
var a:array[1..100]of integer;
n,i,dem:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
dem:=0;
for i:=1 to n do
if a[i] mod 2<>0 then
begin
write(a[i]:4);
inc(dem);
end;
writeln;
writeln('So so le la: ',dem);
readln;
end.
Bài 1:
Program HOC24;
var a: array[1..1000] of integer;
i,n,d: integer;
begin
write('Nhap so phan tu: '); readln(n);
for i:=1 to n do
begin
write('Nhap so thu ',i,': '); readln(a[i]);
end;
for i:=1 to n do if (a[i]<0) and (a[i] mod 2=0) then d:=d+1;
write('Co ',d,' so nguyen am chan trong day so');
readln
end.
Bài 2:
Program HOC24;
var a: array[1..1000] of integer;
i,n: integer;
t: longint;
begin
write('Nhap so phan tu: '); readln(n);
for i:=1 to n do
begin
write('Nhap so thu ',i,': '); readln(a[i]);
end;
t:=0;
for i:=1 to n do if a[i] mod 5=0 then t:=t+a[i];
write(Tong la: ',t);
readln
end.
#include <bits/stdc++.h>
using namespace std;
long long dem,x,n,i,t;
int main()
{
cin>>n;
t=0;
dem=0;
for (i=1; i<=n; i++)
{
cin>>x;
if (x%2==0)
{
dem++;
t+=x;
}
}
cout<<dem<<" "<<t;
return 0;
}
program im_14424;
uses crt;
var A: array[1..9999999] of interger;
S,P : integer;
i,n: byte;
begin
clrscr;
S:=0;
P:=0;
for i:=1 to n do
begin
write('Nhap vao phan tu thu: ',i,);
readln(A[i]);
S:=S+A[i]
P:=P*A[i]
end;
writeln(S);
write(P);
readln;
end.
program BaiTap;
var
A: array[1..150] of integer;
N, i, sum: integer;
begin
write('Nhap so phan tu cua day A (N <= 150): ');
readln(N);
for i := 1 to N do
begin
write('Nhap phan tu thu ', i, ': ');
readln(A[i]);
end;
writeln('Day so vua nhap la:');
for i := 1 to N do
write(A[i], ' ');
writeln;
sum := 0;
for i := 1 to N do
if A[i] mod 2 = 0 then
sum := sum + A[i];
writeln('Tong cac phan tu chan trong day la: ', sum);
readln;
end.
uses crt;
var i,n,n,d: integer;
t: real;
A: array[1..32000] of integer;
begin
clrscr;
readln(n);
for i:=1 to n do
readln(a[i]);
for i:=1 to n do
if a[i] <0 then
begin
d:=d+1;
t:=t+a[i];
end;
writeln('Tong la:',t/n:2:4);
write('Co tat ca so so am la:',d);
readln;
end.
Mik đag cần gấp chiều nay nhờ mn giải giúp mik 😆😆😆