Những câu hỏi liên quan
Tali
Xem chi tiết
Nguyễn Lê Phước Thịnh
17 tháng 5 2021 lúc 9:40

Câu 4: 

uses crt;

var a:array[1..100]of integer;

i,n,dem,t:integer;

begin

clrscr;

write('Nhap n='); readln(n);

for i:=1 to n do 

 begin

write('A[',i,']='); readln(a[i]);

end;

dem:=0;

t:=0;

for i:=1 to n do 

  if (10<a[i]) and (a[i]<20) then 

begin

inc(dem);

t:=t+a[i];

end;

writeln('So phan tu lon hon 10 va nho hon 20 la: ',dem);

writeln('Tong cac phan tu lon hon 10 va nho hon 20 la: ',t);

readln;

end.

Bình luận (0)
Nguyễn Lê Phước Thịnh
17 tháng 5 2021 lúc 9:41

Câu 5:

uses crt;

var a:array[1..100]of integer;

i,n,dem,t:integer;

begin

clrscr;

write('Nhap n='); readln(n);

for i:=1 to n do 

 begin

write('A[',i,']='); readln(a[i]);

end;

dem:=0;

t:=0;

for i:=1 to n do 

 if a[i] mod 2=0 then 

begin

inc(dem);

t:=t+a[i];

end;

writeln('So so chan la: ',dem);

writeln('Tong cac so chan la: ',t);

readln;

end. 

Bình luận (0)
Tali
Xem chi tiết
Nguyễn Lê Phước Thịnh
12 tháng 4 2021 lúc 23:03

uses crt;

var a:array[1..100]of integer;

i,n,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 (10<a[i]) and (a[i]<20) then inc(dem);

writeln(dem);

readln;

end.

Bình luận (2)
ngomanhcuong
Xem chi tiết
Nguyễn Lê Phước Thịnh
15 tháng 3 2022 lúc 20:25

#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;

}

Bình luận (0)
Huỳnh Mai Anh Thư
Xem chi tiết
Nguyễn Lê Phước Thịnh
21 tháng 12 2020 lúc 19:16

uses crt;

var a:array[1..100]of integer;

i,n,dem,t:integer;

begin

clrscr;

write('Nhap n='); readln(n);

for i:=1 to n do 

  begin

       write('A[',i,']='); readln(a[i]);

  end;

writeln('Cac so chan la: ');

dem:=0;

t:=0;

for i:=1 to n do 

  if a[i] mod 2=0 then

   begin

write(a[i]:4);

t:=t+a[i];

inc(dem);

end; 

writeln('Tong cac so chan la: ',t);

writeln('Trong day co ',dem,' so chan');

readln;

end.

Bình luận (0)
ksie
Xem chi tiết
Nguyễn Lê Phước Thịnh
20 tháng 1 2022 lúc 15:11

uses crt;

var n,i,dem,j,t:integer;

kt:boolean;

begin

clrscr;

readln(n);

t:=0;

for i:=2 to n do 

begin

kt:=true;

for j:=2 to i-1 do 

  if i mod j=0 then kt:=false;

if kt=true then 

begin

write(i:4);

t:=t+i;

end;

end;

writeln;

writeln(t);

readln;

end.

Bình luận (0)
06 mkhang
Xem chi tiết
Lam Nguyễn Xuân
Xem chi tiết
Nguyễn Lê Phước Thịnh
7 tháng 5 2021 lúc 22:03

uses crt;

var a:array[1..100]of integer;

i,n,k,t: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 k=0 then t:=t+a[i];

writeln(t);

readln;

end.

Bình luận (0)
IVR Gaming
15 tháng 10 2021 lúc 10:16

lớp 11 bth học quy hoạc động ??

 

Bình luận (0)
namok123
Xem chi tiết
Thuy Bui
20 tháng 2 2022 lúc 17:02

tham khảo

 

#include <bits/stdc++.h>

using namespace std;

long long n,i,nn,t1,t2,dem1,dem2,a[1000];

int main()

{

cin>>n;

for (i=1; i<=n; i++) cin>>a[i];

nn=a[1];

for (i=1; i<=n; i++) nn=min(nn,a[i]);

cout<<nn<<endl;

for (i=1; i<=n;i++)

if (a[i]%2==0) cout<<a[i]<<" ";

cout<<endl;

for (i=1; i<=n;i++)

if (a[i]%2!=0) cout<<a[i]<<" ";

cout<<endl;

t1=0;

t2=0;

dem1=0;

dem2=0;

for (i=1; i<=n; i++)

{

if (a[i]%2==0)

{

t1+=a[i];

dem1++;

}

else 

{

t2+=a[i];

dem2++;

}

}

cout<<t1<<" "<<dem1<<endl;

cout<<t2<<" "<<dem2;

return 0;

}

Bình luận (0)
Nguyễn Lê Phước Thịnh
20 tháng 2 2022 lúc 22:56

uses crt;

var a:array[1..100]of integer;

i,n,min,t1,t2,dem1,dem2:integer;

begin

clrscr;

readln(n);

for i:=1 to n do readln(a[i]);

min:=a[1];

for i:=1 to n do if min>a[i] then min:=a[i];

writeln(min);

writeln('Cac so chan la: ');

for i:=1 to n do 

if a[i] mod 2=0 then write(a[i]:4);

writeln;

writeln('Cac so le la: ');

for i:=1 to n do 

  if a[i] mod 2<>0 then write(a[i]:4);

writeln;

t1:=0;

t2:=0;

for i:=1 to n do 

begin

if a[i] mod 2=0 then t1:=t1+a[i]

else t2:=t2+a[i];

end;

writeln(t1,' ',t2);

dem1:=0;

dem2:=0;

for i:=1 to n do 

  begin

if a[i] mod 2=0 then dem1:=dem1+1

else dem2:=dem2+1;

end;

writeln(dem1,' ',dem2);

readln;

end.

Bình luận (0)
Vân Cẩm
Xem chi tiết
Kiều Vũ Linh
6 tháng 5 2023 lúc 9:17

1) Đề chưa rõ ràng!

2) var a:array[1..1000] of real;

i,n:integer;

min:real;

begin

write('n = ');readln(n);

for i:=1 to n do

begin

write('Nhap so thu ',i,' = ');readln(a[i]);

end;

min:=a[1];

for i:=2 to n do

if a[i] < min then min:=a[i];

write('So nho nhat trong day la ',min:10:2);

readln

end.

Bình luận (0)